You are hereHome / Development / Respect your programming language
Respect your programming language
I recently started to write some kind of marketplace application for some friends of mine (I just can't say no to anyone...) using PHP 4.3. At the begining, I thought to myself: "Hack, how difficult that may be?" Consider: it's PHP! No programmer I know has any respect for PHP, nor had I. Hey, I'm doing very advanced meta modelling concepts in C++ the whole day! PHP will be snatch! Couldn't have been more abroad...
I started buying three different books about advanced PHP programming. Thats what I always do if I step into something new: buy books. At least two on each topic, because no book is complete. And you better always listen to several voices.
OK, books read, still no problems in sight. PHP definitly is trivial. But things turned out different. After a short time, I noticed that everything I did in PHP became messy faster then you can spell "Just a stupid scripting languange". Even though I splitted static and dynamic parts of the site, so static parts can be included whereever approbiate. And though I put everything into neat functions. And though... still mess!
What had happened here? I obviously violated one of the basic rules of programming: Show respect for your programming language. PHP is easy, yes. And it's just too easy to produce bad code in PHP. But it is hard to write good.
What I didn't realized due to my tender arrogance was the simple fact, that PHP on websites deals with several problems OO enterprise application programming doesn't:
- PHP-Applications generate HTML. And if you do not take care, HTML is spread throughout your PHP code, tying presentation and business logic together.
- PHP mostly is sequential, for example the MySQL database methods. If you are an OO junky like me, you should think about a way to deal with this. Before you start!
- HTML pages consist of tons of repeating code, just changing a teeny weeny bit for each page. If you do not have a concept for this, redundance swallows in and changes become a pain.
To be continued: Muddling out instead of muddling through..


Hi Gerd
I like your comments on PHP and way that OO funs that do high meta modeling contepts view at it. Would be of great use if I ever do some PHP programming.
Like your writing style.
If you can add some pictures that ilustrate content, would be great.
Subscribing to new news also would be good (for example if I want to know when "Muddling out instead of muddling through" will be on the site).