Mixed feelings about PHP vs THE BIG GUYS

Lately i was readin some more about current Java based frameworks and development platforms. We even had some presentations from TOP players (Ill call them the Bestests) in Java world. To be honest i was very unimpressed. I started to look more critical on the Java community.

For years i had some Java fascination that was planted in my brain by Bestests when i was in high school. I always though 'well damn! if they have the best people and best minds, if they have shitload of money ... that has to lead to something great right?!'. Well im not sure any more. Maybe its that online content managment is not Java's good side? maybe we were unlucky with the presentations and frameworks we saw so far?

Its just that tools we were shown were not really so cool at all. Lacked usability and/or major functionality flaws and seemed really complex to manage and support. Its just like they design it so complex to sell support and consultants for big cash.

To me it is a wake up call. PHP is really cool even if you compare it with gigants. Even that its open source developed by people who dont get tons of cash, its a great technology. Ask yourself 'why has J2EE been such failure'? Even the collections, which are like the most basic thing, were designed wrong way at the beginning. Then the improvement version came and people were still not happy so finally generics came. I have to say generics and autounboxing are nice features for Java but they add way too much complexity on language level. When can i cast types implicitly when not? which method will override or be called etc.

Even in university i remember one of my professors was crazy about XML and Oracle. Everything had to be done in XML in java and Oracle. I was just starting to work with PHP and i just could not believe that generation of HTML from stored procedures written in Java from within the DB server is a good idea! When i think of it now i think it was just crazy that it was considered by some people as 'the best way to code'. Most complex way to do it does not have to be the best.

When i think of J2EE its just so over engineered. Its just laughable that people could be expected to create thousands of lines of XML configs to setup navigation rules or mappings of things that should be a simple convention. Fortunately new frameworks and new revisions of J2EE seem to be much more lightweight like managed beans. Java world understood that POJOs are good and you cant force people to implement millions of interfaces and useless methods.

Still, the amount of frameworks and ways to do it is overwhelming. The bad part is that most of these solutions are as overengineered as J2EE. Even stuff as simple as logging grows to size of apocalyptic API. How come? Could it not be a bit simpler? Finally i came across logback and SLF4J which make much more sense. I still wonder how come no one thought of that for 10 years of log4j existance? Why could libraries not include some examples like PHP manual does?

PHP on the other hand has its drawbacks but different ones. I will be the last person to say that PHP is flawless. I would account 3 main problems:

1. Fatal Errors and inconsistency in API. It would be so much better to have an php.ini switch converting all errors into exceptions and leaving warnings and other crap as they are now. I know some said that parse error can not be handled or that parser would be in inconsisten state? Well i have to say tough luck. There is no situation when client can see blank page. If you can not parse one of templates or load a new class you should definitely not stop the execution just throw a runtime exception.

I was also thinking why not create wrappers for every PHP call and convert it to namespaced and exception aware OOP code? That would be quite cool. But still .... its a lot of work and you still have all these fatal errors :/

2. Unsupported features or poorly supported features. Lately created a simple XSD to validate xml format and got

DOMDocument::schemaValidate(): Unimplemented block at 
/SourceCache/libxml2/libxml2-17.7.9/libxml2/xmlschemas.c:5588E

Quick look into libxml source ....

#define TODO \
xmlGenericError(xmlGenericErrorContext, "Unimplemented block at %s:%d\n", __FILE__, __LINE__);

Well is that not just great? I know its not PHP fault as it underlying library that does not support some features. But that is the whole point. The Bestests trying to keep the field clean of little guys. They come up with these gigantic specifications. Then it takes years to implement it. Then you have to wait another year or two to get open source implementations. That is the way we will never have full web services security support and many other technologies as they will become deprecated before open source finds time to implement those monster APIs.

3. Lack of support from top cash cows of IT market. I really like what has been dome with zend framework. I like the fact that cake, symfony and pear are still doing well. I hope it will be going in the right direction.

Any way, i think i lost my plot writing that post. The bottom line is that i am getting a new respect for PHP. I think i will write some more once i get my thought together :- )

The PHP community is doing really great job keeping the technology on top. Its use for web is really great and Java might not be as flexible and as dynamic to be used in agile companies. What is the most interesting that most of the do not get paid. Should all these billion dollar companies be able to come up with something better?

People of PHP, be proud of what you are doing and keep it on.

Comments

Post new comment

Image CAPTCHA