4 ms·
Let me go out on a limb and speak for many people with broad generalizations: Many of us have contempt for earlier versions of ourselves. Many of us started o
by MalcolmDiggs 12y ago
Let me go out on a limb and speak for many people with broad generalizations:
Many of us have contempt for earlier versions of ourselves.
Many of us started on PHP, hacking together wordpress and joomla and drupal sites, etc. We cut our teeth on it. We went from incompetent to competent on it. But then we decided we wanted to be something bigger, something better, something more professional. So we jumped on the flavor of the month (a few years ago it was RoR, now it's Node, soon it'll be Golang) and we never looked back. Since this hot-new-thing looked and acted and felt nothing like the old thing, we figured the new thing was good, and therefore the old thing was bad.
Now the new junior programmers remind us of our old selves. We've got no patience for it. It makes us uncomfortable to think that we were ever that new, ever that unseasoned or naive. They're using PHP? Oh well that only reinforces that I'm above it now. In this way our disdain for PHP is only a self-congratulatory indulgence. We're patting ourselves on the back for making that choice to leave it behind.
Like the bullies in the hallway at school, we're just a bunch of insecure people. And that's why we keep shoving PHP into a locker.
- gumballhead 12y agoI think you nailed the answer to the question. Many people are going to come in and answer a different question (why PHP kinda sucks), while willfully ignoring that you can make pretty reasonable arguments about why any language/framework/environment kinda sucks. PHP seems to get a special amount of hate because to most of us PHP coder means newb because that's what we were when we wrote PHP. It's main strength is as a server-side rendering language, with everything else bolted on. That's fine if your requirements are simple. It's not really practical to make that work side-by-side with mobile clients. Developers are finding languages that provide asynchronous (node) or concurrent (golang) features to be more important when you're mapping data from many different sources to json output. It's worth noting that Ruby and Python don't really provide those things either, but have much better reputations as back-end languages. I don't think that will last though. I can easily picture a world where people say, "LOL Ruby! That's what we used in boot camp!"
- bendmorris 12y agoI only started using PHP this year (legacy project at work), and I also strongly dislike PHP. What I dislike about (server-side) PHP: - Ugly syntax. For the languages with algol-inspired syntax, I feel PHP has the most oddities: "$", "=>", foreach (collection as iterator), etc. - Inconsistency in the standard library. Naming - does the function I want have an underscore or not? isset doesn't, is_array does. The ordering of function arguments is also often different from one function to the next. IDE or php.net can help you with this, but when you're in a productive flow, this is an unnecessary impediment. - Doing OOP in PHP, you get a lot of the verbosity of a language like Java without the type safety or standard library features. Nested arrays are common because there is a distinct lack of useful data structures in the language. Arrays are used as a mishmash of array/linked list/hash map because the language doesn't differentiate, leading to subtle bugs. - As a dynamic language, I feel it compares unfavorably to Python in just about every meaningful way. Much more verbose than Python (list, generator and dictionary comprehensions, for example, cut down on a lot of boilerplate in Python.) Less powerful metaprogramming (in Python you can override __setattr__ to execute code whenever attributes are set; in PHP you can define __set magic attribute which doesn't work on public attributes, limiting its usefulness.) The standard library is less useful. It's not as simple to package and deploy. - Modern features are starting to creep into in the language, but I feel it's too little too late. We recently had to upgrade a server to PHP 5.5 because I sold decision makers that using generators to stream data would result in much more maintainable code than shoehorning what we were trying to do into iterators. For a moderately large company with enough legacy, upgrading the PHP version can be an ordeal. Python has featured generators since 2003. - I do feel that quality of candidates is an important consideration. A lot of people cut their teeth on "HTML, CSS and PHP" before moving up to "real" programming languages. The rate of applicants who don't have strong programming ability will be higher for PHP than for comparable languages. I've been using PHP professionally for almost a year and I would never use it for a project unless it was already in use.