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
-
willol13898yI use PHP a lot, and except for small trivial programs I don't know how PHP is less verbose
-
SnafuAI6848yShort answer: Because we have seen so much shitty code written in PHP that it's hard to imagine it being used to write good code.
Long answer (more of a list of issues):
-It is very easy to "learn" so even incompetent "developers" can and will use it. This is quite an inconvenient for people that do put effort into their craft since it lowers prices (why should I pay you this amount when X will do it for 10% of that - most clients will not know the difference between good and bad code), creates a bad perception of our trade when clients face the problems created by the cheap coder they hired, etc.
-It is not as formal as C#, Java or other languages and that allows for code that is poorly written but seems to work fine. (i'm not saying that is not possible in these other languages - just a bit harder).
-Performance is... bad.
-It was first designed as a scripting language and then hammered in the current role. As such, it lacks a proper architecture for the purpose.
1000 chars limit... -
While i've only used PHP a little bit, i've always found it wasn't great at adhering to standards, and everything was just a little different.
Case and point: https://reddit.com/r/lolphp/... -
SnafuAI6848y@liammartens
I am sure the speed improved but I guess it's still slower than Java or C#.
Also, what's the install base of PHP7 compared to 5 and 6? I'm more than sure that a lot of sites still run on older versions. -
Grom3598y@SnafuAI Speed in PHP7 is actually quite decent, even though Java and C++ can be a lot faster.
sauce: https://blog.famzah.net/2016/02/...
Hardly anything runs on PHP7 at the moment, but i've been getting the feeling the last few years that PHP 'is getting there and growing up'. -
SnafuAI6848y@Grom
I'm not talking as much about junior developers - those will make mistakes, indeed, but they get better - but about people that will call themselves programmers even though all they do is use copy/paste from StackOverflow and similar sites without ever bothering to understand what it does.
You can write bad code in any language, but somehow PHP attracted a lot of unskilled wanna be "programmers".
Also, I understand your question very well - I am a Java developer (another language that gets a lot of hate). -
Grom3598y
-
PHP is quite badly designed and contains lots of inconsistencies and caveats that make it quite annoying to work with.
Functions with configuration dependent behaviour, overall shoddy unicode support, functions with misleading names, etc all contribute to make developers job harder.
Its not a huge problem on small projects targeting english speaking users but for big projects where some devs will be less experienced it is a pain in the arse.
I've rejected 4 pull requests this week because junior devs used str_ functions instead of mb_ functions, 1 due to incorrect use of empty and 2 due to implicit typecasts in switches (switch does its comparison using == rather than the stricter === so most of the time you want to do switch(true) {case $foo === $bar: ...} instead of switch($foo) { case $bar: ...}, all of which are mistakes that simply can't be made (or atleast are harder to make) in modern languages.
This all results in a huge waste of time for senior devs and a lot of php hate. -
@SnafuAI although I haven't run any benchmarks or anything but I am 90% sure PHP7 with a framework like Phalcon which is a installed as a C extension can be just as fast if not faster as C# (ASP im guessing) or Java (no clue haha). So if you know what you are doing its definitely faster/better in my opinion ☺
-
peb7268508yThe question is what would you write in PHP that wouldn't be more fun, more efficient, and done in a more modern way using JavaScript?
Related Rants
Serious question: why all the hate on PHP?
I've been using it as my main language, and genuinely like it. Tried Java but find that to be typing a fuckload to get the same task done. Javascript is nice, but still, i prefer PHP (probably mostly because i know it).
Just really curious, what have i been missing?
undefined
php