Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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. -
inaba46256yThis is an omen. Soon there will appear another rant where someone says something dumb about JS' types
-
inaba46256yHeres a screenshot from the last time someone asked, of a screenshot when someone asked before, of a post from when someone asked even earlier.
-
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. -
bezorp3746yNah 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. -
inaba46256y@bezorp This, however, has nothing to do with what is bad about PHP and is pretty meaningless
-
C0D4681466yEveryone 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). -
inaba46256yI 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 -
mrrmc2266yBecause 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...
Related Rants
Why does everyone hate/bag out php?
question
php
hate