I had to do some hardcore PHP development recently. ��� �������� ������� ��������� ������ PHP �������� � ��������� �����. I got a new perspective on PHP during this time. � ������� ����� ������ �� PHP � ������� ����� �������. 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. PHP ���������� � ����, ����� ������� ����� ������������ �����. 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. Java, � ������ �������, ��� � ������� ������� ������������ (API ������) � ����� ����������� ����������� ��������. Resource could be memory, processing power or hard disk. ��������� ����� ���� ������, ��������� ������ ��� ������� ����.

For example most of Java I/O API is based on stream processing paradigm. �������� ������� ����� Java I / O API ������� �� ����� ��������� ���������. 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. ����� ������ IOException � ������ � BUF_SIZE �� ����� ��� � ������� readLine �� BufferedReader, �� ������.
By contrast in PHP I just call file(). � ����������������� ����� � PHP � �� ������ ������� ���� (). Why doesn't core Java have these functions? ������ �� �������� Java ��� �������? They are very simple to provide. ��� ����� ������ ������������.
I think it is because Java think-tank wants to encourage programming with resource constraints in mind. � �����, ��� ������, ��� Java ��������� ������ "����� �������� ���������������� � ������������� ��������� � ����. remember Java had an Oak background, a language targeted for limited resource devices. ��������� Java ���� ��� �������������, ����� �������� �� ������������ ������ ���������.

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

Pages: 1 ��������: 1 2 3 4 5