59

I'm a PHP programmer and it hurts my heart whenever I see a lot of developers attack/hate PHP.

Why do they hate PHP that much? 😞

Comments
  • 24
    Because of it's flexibility actually, some people criticize the fact that at the beginning you didn't have oop, or the fact PHP is not like Java or C#, an organized language strongly-typed driven. Also the fact is so "quick" to learn and have something working in less time. For these reasons some php programmers are lazy motherfuckers who don't even indent.
  • 10
    I like it. It works 😊
  • 7
    @lumogox some don't indent?! Wow. What a shame
  • 13
    PHP has grown up with its 5.3 release. (Esp. with namespace support.) Now it's much more like Java than any other web language I know yet without the verbose syntax. And the toolset has also matured so much with composer, phpunit, symfony components, etc..

    Still, the way php is perceived still stems from its early times as a tool used by script kiddies and to this day, a lot of bad programmers write bad php code (classic old mess between php, mysql and html all in one big file) giving the language a bad image in the process.

    On the other hand it also speaks volumes about its accessibility. Lot of people start programming with php because it's rather easy to get into it than say haskell.

    I don't want to apologize the needless hate php gets.

    In the end, there are two kinds of programming languages: The ones nobody complain about, and the ones people are using.
  • 2
    The fact that it is installed everywhere (virtually every host supports PHP), and often the first web langyage anyone learns means the odds of PHP code you encounter in the wild being bad is higher than other less accessible languages.

    Same goes for hiring : the odds of a random PHP programmer being great are low (well, a programmer who only knows one language have high odds of being bad anyway).

    On the merits of the language itself, every language as flaws. It is often argued that, as a whole, PHP has more flaws (both in quantity and impact on programming) than other popular languages, making it a sub-standard choice, unless one of your goal is to be easily accessible (see first point).

    A lot of people, including me, have been burnt by bad PHP code. It tends to leave a lasting impression.
    I still have to work with one of the big PHP CMS, and I despise every time I have to touch it, there are just so much bad programming practices in it.... But that's for another rant!
  • 1
    From my experiences, it's usually a superiority complex.
  • 1
    They hate it because they cannot write good code
  • 1
    It's not are for PHP as a language, it's are just for PHP developers (the language has no choice to be as it is, the PHP developers have the power of choice and they don't use it)
  • 0
    @dejabuuu Welcome to devRant!
  • 1
    Because I started using better languages and frameworks and realized it was garbage.
  • 0
    Hmmm 💭
  • 1
    This was posted up the other day https://wiki.theory.org/YourLanguag...

    It's not just php, other languages are there too, they just have different issues.

    A good programmer should be aware of limitations or issues like these as they can be a source of bugs, weird behaviour, security holes etc.
  • 0
    Ahem... Devrant uses a PHP API...
  • 0
    Oops forgot to drop a mic...**mic drop**
  • 0
    It seems like everyone here so far are uniformly attributing the hate the community has towards PHP to the encounters devs have with bad PHP code across the net. That very well could be for many hating devs but keep in mind there are issues deep within PHP that causes a big chunk of devs to build hate for it...

    PHP is a very clunky and messy lang that is terribly inconsistent across the board with many diff philosophies it evolved with across the years.

    It has a less-practical syntax relative to most langs that makes things painfully annoying to do.

    It has a notoriously bad and complex error reporting system and thus is very difficult to debug.

    It has too many unexpected "surprises" and weird API tangles. Some funcs accept the subject in the first pos argument while others accept it in the 2nd or 3rd arg; I'm talking about funcs that belong into the same logical category e.g. str_replace and substr and more...

    In detail:
    https://eev.ee/blog/2012/...
  • 1
    What pisses me off the most when going back to PHP is that PHP uses "->" for calling methods and using . instead of + to concatenate strings.
  • 0
    @danielkalen JS is super weird syntax and also has awful debugging experience out of the box...
  • 1
    I think PHP is great for quick prototyping and getting something off the ground quickly. That's why I recommend it for new startups. The learning curve is very shallow, and it's not necessary to learn a complex library like Rails or Django on top of the language itself.

    However, the language's lack of an opinion about how your code should look tends to encourage disorganized code. Worst of all is when complicated logic happens right in the middle of HTML generation, and you can't change presentation without changing the logic or vice versa.

    If a PHP app has been growing well for a few years, I push strongly for a different language that encourages more structure. As the app gets bigger, keeping track of all the includes gets unmanageable, files get scattered everywhere, and the global namespace becomes a mess, with nary a test in sight. Almost any other language will encourage and enforce better hygiene. I've coded in all these and prefer them to PHP: Ruby, Python, Java, Go....
  • 0
    I use it sometimes in a legacy system at work and my experience is that methods are fucking confusing and inconsistent. Sometimes you pass in an array but sometimes you change the array in place. Why this inconsistency?! It makes it really hard to remember what to use.
Add Comment