Use of Content Type Header

“Content-type: text/html; charset=iso-8859-1”

Content-Type header with charset is used for telling browser which type of content you have to show and which additional encoding is applied to the content.

RFC 2616 HTTP 1.1:

When an entity-body is included with a message, the data type of that
body is determined via the header fields Content-Type and Content-
Encoding. These define a two-layer, ordered encoding model:

entity-body := Content-Encoding( Content-Type( data ) )

Content-Type specifies the media type of the underlying data.
Content-Encoding may be used to indicate any additional content codings applied to the data, usually for the purpose of data compression, that are a property of the requested resource. There is no default encoding.
Any HTTP/1.1 message containing an entity-body should include a Content-Type header field defining the media type of that body.

You can specify content type by adding:

<meta name=’Content-Type’ Content=’text/html; charset:UTF-8′ />

between <head> and </head> tags.

This will set your content type in your document. But some browser like Mozilla do not accepts content-type correctly when set by this method. So you should set content type using server setting also. Server side setting will set default content type and encoding for all documents. You can set content type and encoding document wise using server side scripts also.

In PHP add this line at the top of script:
header (‘Content-type: text/html; charset=iso-8859-1’);

Some time you may have noticed in a document that junk character is coming. If this is the case with your document then you can control it. For multiple languages UTF-8 is the best choice. General accepted encoding is ISO-8859-1.

What to do if your document is not showing correctly after using <meta> in html and header(‘Content-Type:….’) from server side server.

I have simple test based on trial and error method that will work for you. In Internet Explorer: View -> Encoding and select encoding type one by one. In Firefox, View->Character Encoding and select encoding type one by one. One encoding or multiple encoding suits to you. Now after identifying content encoding you can use that at both places.

In Firefox you get additional information about any document by using Tools-> Page Info.
Here you will get info. About all Meta used, type, Cache source, render Mode, Encoding, Size, Referring URL, Modified and Expire. This was just example. You will also get form, links, media and security informations.

Types of PHP Framework: Glue and Full-Stack

PHP frameworks are in great news from 1-2 years in PHP community. Lots of PHP frameworks are available to choose from. Framework is good for development for few reasons. This provides lots of developed code for reuse. All frameworks have community where developers can get help. Discussing your problem there can be easy as all are connected through a common framework. Framework has codes developed by experts so you are also getting help by this. Frameworks use good design principle. It forces many to develop good codes. Though in many cases it can be hindrance for implementing your new ideas.

These days you may get lots of projects, which demands to be developed on top of good Framework. So learning PHP framework can be a good investment for developer.

Frameworks are divided on two broad categories: Full-Stack and Glue framework. Glue frameworks are not tightly coupled and provide greater flexibility than Full-Stack framework. Glue Framework allows advance developer to choose their way to use the existing codes base from framework. Full-Stack framework is tightly coupled so one way it is sometimes difficult to implement your own ideas but other way it requires less work to make things work. Full-Stack framework saves you development time by providing per-built logic for common application patterns.

Important frameworks:

Symfony – Based on MVC architecture, it is very much in news as a good PHP framework. This comes in Full-Stack framework. Licensed under New BSD license.

CakePHP – This comes in Full-Stack Framework. Licensed under MIT license.

CodeIgniter – Licensed under Proprietary category. This is Glue type framework.

Zend Framework – It is both full-stack and glue type framework. Comes with New BSD License. It is consuming widely available APIs from leading vendors like google, amazon, yahoo!, Fliker and others.

Solar – It is Full-Stack framework, making inroads very fast into great developer minds. License: New BSD.

Prado – Full-Stack type and licensed under New BSD.

Programming Language Rating in 2008

The TIOBE Programming Community index gives an indication of the popularity of programming
languages. The index is updated once a month. The ratings are based on the number of
skilled engineers world-wide, courses and third party vendors. The popular search engines Google, MSN, Yahoo!, and
YouTube are used to calculate the ratings. Observe that the TIOBE index is not about the best programming
language or the language in which most lines of code have been written.

The index can be used to check whether your programming skills are still up to date or to make a
strategic decision about what programming language should be adopted when starting to build a new
software system. The definition of the TIOBE index can be found here.

Position
Jul 2008
Position
Jul 2007
Delta in Position Programming Language Ratings
Jul 2008
Delta
Jul 2007
Status
1 1 Java 21.345% +0.33% A
2 2 C 15.945% -0.42% A
3 3 C++ 10.693% +0.19% A
4 4 (Visual) Basic 10.447% +0.72% A
5 5 PHP 9.525% +0.87% A
6 6 Perl 5.131% -0.20% A
7 8 Python 4.973% +1.95% A
8 7 C# 4.000% +0.29% A
9 9 JavaScript 2.757% +0.24% A
10 10 Ruby 2.735% +0.64% A
11 13 Delphi 2.011% +0.51% A
12 14 D 1.224% -0.14% A
13 11 PL/SQL 0.736% -1.23% A
14 12 SAS 0.629% -1.23% B
15 PowerShell 0.436% +0.44% B
16 23 Pascal 0.432% -0.05% B
17 17 COBOL 0.413% -0.17% B
18 18 Lua 0.408% -0.17% B
19 16 Ada 0.407% -0.20% B
20 15 Lisp/Scheme 0.384% -0.30% B

Other programming languages

The complete top 50 of programming languages is listed below. This overview is
published unofficially, because it could be the case that we missed a language. If
you have the impression there is a programming language lacking, please notify us
at tpci@tiobe.com.

Position Programming Language Ratings
21 Logo 0.367%
22 ActionScript 0.363%
23 FoxPro/xBase 0.357%
24 RPG (OS/400) 0.328%
25 Fortran 0.292%
26 ABAP 0.261%
27 MATLAB 0.253%
28 Prolog 0.221%
29 Awk 0.200%
30 Transact-SQL 0.164%
31 LabVIEW 0.159%
32 Bourne shell 0.158%
33 PL/I 0.152%
34 Euphoria 0.151%
35 Smalltalk 0.124%
36 Erlang 0.121%
37 DC 0.118%
38 Groovy 0.117%
39 Haskell 0.109%
40 ML 0.109%
41 Tcl/Tk 0.105%
42 CL (OS/400) 0.101%
43 Forth 0.092%
44 Lingo 0.089%
45 REXX 0.088%
46 Caml 0.087%
47 Objective-C 0.085%
48 Natural 0.082%
49 R 0.082%
50 APL 0.081%

The Next 50 Programming Languages

The following list of languages denotes #51 to #100. Since the differences are relatively small, the programming languages are only listed (in alphabetical order).

  • ABC, AD, Algol, Alpha, Applescript, AspectJ, Beta, Boo, C shell, cg, Ch, Clean, cT, Curl, Dylan, Eiffel, Factor, Felix, Focus, Icon, IDL, Inform, Io, MAD, Magic, Maple, Mathematica, Modula-2, MOO, MUMPS, Oberon, Occam, Oz, Pike, PILOT, Postscript, PowerBuilder, Progress, Q, REALbasic, Rebol, S-lang, Scala, SIGNAL, SPSS, TOM, VBScript, Verilog, VHDL, XSLT

July Newsflash – Brought to you by Paul Jansen

  • Powershell seems to become the next new scripting language on the front after the breakthrough of Ruby (2006) and Lua (2007). Powershell is sometimes positioned as the successor of the good old DOS batch language, but it is in fact a real .NET scripting language with nice functional features.
  • In the tables below some long term trends are listed about categories of languages. The object-oriented paradigm is at an all time high with 56.6%.
    Category Ratings July 2008 Delta July 2007
    Object-Oriented Languages 56.6% +3.9%
    Procedural Languages 41.1% -2.3%
    Functional Languages 1.7% -0.3%
    Logical Languages 0.7% -1.2%
    Category Ratings July 2008 Delta July 2007
    Statically Typed Languages 59.1% -0.2%
    Dynamically Typed Languages 40.9% +0.2%

Andreessen: PHP succeeding where Java isn’t

The simplicity of scripting language PHP means it will be more popular than Java for building Web-based applications, Internet browser pioneer Marc Andreessen predicted Wednesday in a speech here at the Zend/PHP Conference.

Java enjoyed great success when its inventor, Sun Microsystems, released it in 1995, largely because it was optimised better for programmers than for machines, making software development significantly easier, Andreessen said. Unfortunately, Java has acquired many of the unfavorable characteristics of its predecessors, he added.

“Java is much more programmer-friendly than C or C++, or was for a few years there until they made just as complicated. It’s become arguably even harder to learn than C++,” Andreessen said. And the mantle of simplicity is being passed on: “PHP is such is an easier environment to develop in than Java.”

That opinion might not sit well with Java loyalists–and there are plenty of them among the millions of Java programmers and hundreds of companies involved in the Java Community Process that controls the software’s destiny.

But even some influential executives at IBM, which was instrumental in bringing Java to the server and whose WebSphere server software has Java at its core, see the benefits of PHP over Java.

“Simplicity is a huge part of it,” said Rod Smith, vice president of IBM’s Emerging Internet Technologies Group, describing PHP’s appeal to IBM in a meeting with reporters at the conference. “They weren’t interested in adding language features to compete with other languages,” choosing instead “the simple way, and not the way we’ve done it in Java, unfortunately.”

PHP is an open-source project including an engine to simple programs called PHP scripts and a large library of pre-built scripts. Much of its development is in the hands of a company called Zend, which sells packaged PHP products, programming tools and support.

Wooing programmers is nothing new in the computing industry, where players constantly jockey to establish their products as an essential foundation. Indeed, many credit Microsoft’s success to its highly regarded programming tools, which make it easier for developers to write software that run on Windows.

PHP has caught on widely. About 22 million Web sites employ it, and usage is steadily increasing. About 450 programmers have privileges to approve changes to the software. Major companies that employ PHP include Yahoo, Lufthansa and Deutsche Telekom’s T-Online.

PHP is more limited in scope than Java, which runs not just on Web servers but also on PCs, mobile phones, chip-enabled debit cards and many other devices. Some parts of the Java technology, though, such as Java Server Pages, handle much the same function.

“Java and PHP compete at some level. Get over it,” Mike Milinkovich, executive director of Eclipse, said in a meeting with reporters. Eclipse is an open-source programming-tool project that long supported Java and now also supports PHP. “I’m looking forward to PHP kicking butt in the marketplace,” Milinkovich said.

Java and PHP are drawing nearer to one another, though. Oracle, which also sells Java server software and whose database software can be used as a foundation for either Java or PHP, is among those working on an addition to Java to help the two software projects work together. Specifically, Java Specification Request 223 will “help build that bridge between the Java community and the PHP community,” said Ken Jacobs, vice president of product strategy at Oracle, in a speech at the conference.

And even Andreessen, who just helped launch a start-up called Ning for sharing photos, reviews or other content online, acknowledges that Java has its place.

“My new company is running a combination of Java and PHP. This is something I get no end of crap about,” he said of the technical decision. “We have a core to our system that is built in Java. It is more like an operating system, like a system programming project. Then we have the entire application level–practically everything you see is in PHP.”

PHP, like open-source projects including Linux and Apache, now has received the blessing of major powers in the computing industry. IBM and Oracle are working on software that let PHP-powered applications pull information from their databases, and that endorsement has been important, said Zend CEO Doron Gerstel.

“The fact that IBM and Oracle are behind it–this is for a lot of IT (customers) a quality stamp. The big guys endorse it, so it must be good,” Gerstel said in a meeting with reporters.

The new version 5.1 of PHP, scheduled to arrive in early November, will include a faster engine to process PHP scripts, said Zeev Suraski, a Zend co-founder and PHP creator. It also will include a low-level “data abstraction layer” that makes it easier for PHP to communicate with different databases and a higher-level layer to interface with XML information produced and consumed by Web services.

Version 6, which is expected to arrive in 2006, will support Unicode character encoding, which supports a wide range of alphabets, simplifying creation of software that works in multiple international regions.

Andreessen said he believes the Web is where most new applications will reside–in part because Web applications are available as soon as they’re launched, sidestepping the distribution challenge of desktop software.

“Microsoft talks a lot about Avalon (display technology in the upcoming Vista version of Windows) and fat clients. But they still have a problem. You have to get the program out onto everybody’s desktop. With the Web model, you don’t,” Andreessen said. “I think there’s no question the Web model is going to dominate over the next 10, 20, 30 years.”

Some interesting work is being done on the PCs, however, but he pointed only to applications that run in a Web browser and that rely on data and services supplied over the Internet. Here, again, Java is losing to an unrelated scripting technology called JavaScript and a JavaScript offshoot called AJAX that permits a fancier user interface.

“JavaScript was, and now with AJAX is, the standard way to do client-side development in a browser, as opposed to Java,” Andreessen said. “Java applets in the browser never took to the extent some of us thought they would.”

Not everyone sees things the same way. Google uses some cutting-edge browser-based software such as AJAX, but CEO Eric Schmidt took the stage earlier this week with Sun CEO Scott McNealy to announce that the Google Toolbar will be piggybacking on distributions of the desktop version of Java.

“I was amazed to find out how much the Java Runtime Environment is inside companies, either because a CIO standardised on it or there are enough applications that the CIO wants the JRE to be a standard” part of the company’s computing infrastructure, Schmidt said at the Sun-Google event. As part of that partnership, Google will help develop Java.

Netscape pushed JavaScript as a way to build fancier Web pages than the fundamental HTML (Hypertext Markup Language) standard permitted, but without the more difficult programming Java required, Andreessen said. “We did JavaScript to try to be an intermediate bridge between HTML and Java. I got in huge fights with Sun over this,” Andreessen said. “They got mad. Then I told them we wanted to name it JavaScript, and that made them even madder.”

Java isn’t the only client software that didn’t live up to its promise, Andreessen said. Macromedia’s Flash format, which enables animation, sound, motion and other splashy features within browsers, also is on the list.

“I think Flash is one of the most exciting technologies out there that’s almost on the verge of great success and never quite achieving it,” Andreessen said.