I had to do some hardcore PHP development recently. I got a new perspective on PHP during this time. This post is a summarization of my understanding.

In this article I will be making few generalizations. Each of them can a topic by itself, if described in full.
If you want to know more about any topic, let me know.

PHP is geared towards making the life of a developer easy. It has several functions which makes writing code a pleasure. If I want to read a file, I can do it in a single statement. If I want to read it as an array of string I just call file().

Java on the other hand is more focussed (API wise) towards minimizing resource consumption. Resource could be memory, processing power or hard disk.

For example most of Java I/O API is based on stream processing paradigm. While stream processing ensures optimum usage of resources, it makes simple mundane jobs harder. Try reading a file as an array of string. After catching IOException and reading in BUF_SIZE at a time or using readLine on BufferedReader, you are tired.
By contrast in PHP I just call file(). Why doesn't core Java have these functions? They are very simple to provide.
I think it is because Java think-tank wants to encourage programming with resource constraints in mind. remember Java had an Oak background, a language targeted for limited resource devices.

The sad part is that most Java developers get bogged down by such trivialities and cannot see the forest for trees. I know, I know you are an exception.

Pages: 1 2 3 4 5