2

Why does everyone hate/bag out php?

Comments
  • 2
    I don't.
  • 4
    It's a (stupid) trend. Don't worry too much about it.
  • 5
    Because everyone has experienced some dreadful piece of PHP code in their career. It's not that you can't write good PHP code---it just that there's a lot of really bad PHP code out there.

    So many people have PTSD when it comes to PHP.
  • 1
    Because it's in the name
  • 3
    This is an omen. Soon there will appear another rant where someone says something dumb about JS' types
  • 0
    Heres a screenshot from the last time someone asked, of a screenshot when someone asked before, of a post from when someone asked even earlier.
  • 1
    Here's another one
  • 0
    PHP is old, many of the third party docs and tutorials are outdated, teaching techniques that are deprecated or dangerous today.

    Then, there is an amount of things that you have to do yourself - MVC architecture, login and so on - that other technologies automate for you (Ruby on Rails, for example). There are frameworks for PHP, but not something with the market share of Rails. Besides, most novices in PHP don't know how to install one of these. Rails does that for them.

    Package management is also rare with beginners.

    PHP used to be popular among beginners and less-than-professional coders. I used to do PHP when I started web development, but switched to Ruby on Rails for bigger projects.

    You can do professional work with PHP just as with any other language - it's just too easy for its own good.

    I still use PHP if I have scripts that are small and will never grow beyond a couple of hundred lines of code. Anything bigger is a job for Ruby on Rails for me.
  • 2
    Nah it's fine. I've seen some godawful ruby, python, Golang, c#, java, etc.

    Bad code is bad code, even if it's written in a currently sexy language. Conversely, good code is also still good, even if it's written in a currently unpopular language.
  • 0
    @bezorp This, however, has nothing to do with what is bad about PHP and is pretty meaningless
  • 3
    Everyone loves to hate something, and everyone loves a bandwagon.

    Basically, php has countless things wrong with it as a language, inconsistent functions, argument ordering, concatenation with “ . “ and non static methods being called with $this->method() and the greatest flaw is its ability to be loaded into any environment and just work with what ever shit code you throw at it - for the most part - but treat it right and create wrapper classes to handle the inconsistencies if you need too and it won’t be so bad.

    The language doesn’t force you into a decent MVC or OOP coding structure so the laziness of devs choosing to slap PHP around for there lack of attention is usually where the bashing stems from.

    But like anything, you can write the shittiest piece of convoluted bullshit in any language but it probably won’t run, where as PHP will go, “hold my beer” and give it ago anyway.

    PHP is easy to start with and takes a lot of self discipline to master, which introduces n00bies getting there greasy untrained claws and building repulsive shit with it, which creates a community of hate for a misunderstood language of great potential, I mean you can create anything from a CLI tool to a fucking OS with it (yes the OS has been done before).
  • 0
    I don't think . and -> are issues at all. These are not the inconsistencies that people point out when they say that there are. But you already highlighted a major issue. The need to create wrapper classes because of inconsistencies.

    Another issue isn't the fact that it runs with shitty code. Any language runs with shitty code since that's how you obfuscate. Not only that but "shitty code" is also an incredibly vague term that can mean different things to different people.

    You're almost there with it being easy to start off with, but you miss the point. The problem with PHP's ease is the fact that it doesn't scale that well (in terms of adding more stuff). Like having every file being an enpoint seems simple, and having PHP being the templating engine (which is what it started off as) seems simple too. But the more you add to your app the more this process gets complicated.

    And age isn't really an issue either, it's the lack of keeping up that's an issue
  • 0
    Asked by someone who uses Laravel?
  • 1
    Because Php is a developers dream. It fucking works even when you dont want it to. It's super easy to understand and super easy to integrate into the most basic web page as well as super easy to host for free (on linux).

    Now for the problem:

    It makes dev's lazy and leads to a crap load of code doing basically the same thing (why update the old code when you can just write new easy code to replace it) which is a bitch to fix...
Add Comment