Ask HN: What makes PHP so difficult?
Having been awake now for roughly 30 hours coding my php project what makes it such a tough and confusing language? Does MVC complicate matters? Am I reading the wrong books/website and It is actually quite simple? In my humble opinion it's quite possible the worst server side language going.
12 comments
[ 3.1 ms ] story [ 40.5 ms ] threadThree other points though;
Firstly.. being awake for 30 hours is going to make you sleep deprived and confused, which will make it harder to code things. You'll probably find you're more productive coding for 10 hours, sleeping for 10 hours, and then coding for a further 10 hours than trying to code for 30 hours straight.
Secondly, the language you're using is a small part of app development. Tiny in fact. In my experience the "40/20/40" rule is right ... designing and building an app is 40% planning, 20% coding, and 40% testing. That's with about 15 years web development experience.
And lastly, if you think PHP is the worst server side language, you've obviously never written a large scale site in Perl. ;)
You can use it rather nicely, but it also allows you to write some really awful code. Admittedly, it does not do much to help you write good (=understandable, maintainable) code.
This post is rather interesting in terms of using the good parts of PHP:
http://fabien.potencier.org/article/64/php-is-much-better-th...
I have been using the author's PHP framework for 2 years now and have experienced huge improvements in the quality of the code I write simply by being exposed to his example. He basically uses a lot of objects but very little inheritance. He also is religious about the DRY principle.
The only real difference I find is that you need more discipline than you would with django/ror because you can mess it up more easily. PHP feels like C for web programming.
If you feel your MVC framework complicates things it probably is for the former reason (more awkward syntax compared to dj/ror).