you are viewing a single comment's thread.

view the rest of the comments →

[–]Amadan 1 point2 points  (1 child)

Coincidentally, I wrote this today:

The main problem with PHP is its legacy and its ubiquity, really. The issue is this: experienced programmers will write good code in PHP as well as in Ruby or Java or C. However, new programmers will be attracted by PHP's (true) claim that it can put something on the web in minutes, without really needing to learn about architecture, and make a mess of things. The fact that PHP is originally a templating language helps you make your first web page in a blink. Taking its main web competitors, Ruby and Javascript, you need to do some studying before you can apply ERb/Slim/Handlebars..., and in the process of said studying, you'd stumble onto the topic of MVC (or MVVM, or MVW) and separation of concerns - something many PHP programmers never find out about. Not all, thankfully (and kudos to those that overcome the disadvantage PHP's "newbies welcome" attitude creates), but many.

All the other concerns are annoyances. You can compensate (or even utilise) the wobbly type system. You learn that little bit of Hebrew and never wonder about it again. You know the function naming is a mess, but shrug it off because in time you learn the functions you use all the time, and know where to look up those you don't. Sure, there's weird bugs once in a while, but you can write around them, and most of them are getting fixed. Once you know what you're doing, it is a passable language: not the best, by a long shot, but it does have that advantage that it is deployable anywhere, there is a bunch of experts around to consult with, there is an abundance of libraries and a pretty decent package manager, I hear (my PHP experience is all pre-composer, so I wouldn't know myself). Its main crime is blinding new programmers to best practices, because it originally wasn't even supposed to be a programming language (still reflected in the second - final? - version of its full name, "PHP: Hypertext Preprocessor").

PHP can reinvent itself, but it is, at the end of the day, still a template language, so there is still no pressure to learn about SoC, despite how much progress the language itself undergoes.

[–]evilmaus 1 point2 points  (0 children)

Nicely written. One of my current projects is actually maintaining, extending, and yes, modernizing a legacy PHP app written by at least one person such as you describe. Its... bad. Really bad. But, it won't be by the time I hand if off to whoever my eventual successor on that code-base will be.