Proper tools and infrastructure for grownups – or why I dislike php

As I did a really small project in php – testing Zend Framework at the same time – I remembered well reasons for my dislikes in php as I struggled to do even the simplest things fast. PHP as a language is simple and hackish language, which has grown from solving simple personal homepage scripting needs into scripting language used to build large websites and complex functionalities. As with almost any language, if you can imagine it – you can create it also in php.

PHP used to be – and still is in some terms – great language to do something fast. Before others had started their complex application servers or written boilerplate servlet code, php coder had created simple pages that fetched and updated data in a database. And even though I prefer Python as a real scripting language, php is still a really good quick fix web scripting language. However as you build larger web applications, want to reuse code and use some common foundations for your projects, you start to feel some shortcomings of php language and infrastructure. As php and php-frameworks have evolved throughout the years, they have gained more and more features, patterns and tools which have been standard issue stuff for example in java world for years. Result has been that doing professional php programming has become more and more complex, requiring much more cognitive efforts from the programmer.

Frameworks like Zend Framework are doing heroic efforts trying to bring sanity, structure and best practices into php coding – and some ways also succeeding in it. However coming from java and python world things programmers need to do and bear with Zend Framework and php seem ridiculous, as same things are solved much more elegantly in equivalent frameworks in java and python. Zend Framework tries to be a tool for grownups and is designed well. In some ways it resembles a good Java MVC-framework, but without any benefits and safeguards java as a language and java infrastructure brings to your support. But if you don’t any better, Zend Framework is great.

But there is one advantage that php has over any other web scripting language: pervasive nature as the defacto language and availability on each and every cheap hosting provider. However as these days you can get full servers capable of running large java or python applications for less than 50 euros per month, benefit of being able to use $5 hosting is minimal – especially when hosting costs are usually smallest cost in any web project.

I am not saying that php would be a bad tool and you should not use it. I am just saying that doing and managing professional, secure and maintainable code in php is harder in php than in some other environments. If you are great programmer, you can do great work in language with any tools — but the odds are that you and/or the people in your team are not world class superstars, but just regular programmers like the rest of us. Therefore I like to work with tools and environments that help me to keep my stupidity to my self, and not to release it into the production system.

This entry was posted in programming, technology. Bookmark the permalink.

Vastaa

Täytä tietosi alle tai klikkaa kuvaketta kirjautuaksesi sisään:

WordPress.com-logo

Olet kommentoimassa WordPress.com -tilin nimissä. Log Out / Muuta )

Twitter-kuva

Olet kommentoimassa Twitter -tilin nimissä. Log Out / Muuta )

Facebook-kuva

Olet kommentoimassa Facebook -tilin nimissä. Log Out / Muuta )

Google+ photo

Olet kommentoimassa Google+ -tilin nimissä. Log Out / Muuta )

Muodostetaan yhteyttä palveluun %s