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
-
@rephiscorth
If you're gonna bitch about a language, at least tell us what it or you did wrong.
Most of the problems with PHP come from the way people (ab)use the language.
Other languages do make it easy by forcing rules onto you, but there is no reason not to adhere to the same rules in PHP.
Use the latest version (7.1). Use composer for packages. Typehint every single parameter and return value. Use an ORM for database interaction if possible.
If you use a lot of else clauses, you probably need early returns. Switch/case structures should often be replaced by reference objects/arrays.
Using for is stupid, hard to read, and error-prone. Use foreach.
Actually, foreach is stupid, because it can cause side effects. Use array_map, etc.
Actually, array_map is stupid because the implementation is inconsistent and verbose, Use collections or ds objects on which you can implement fluent methods.
Eh, you're right, PHP is a mess sometimes.
But it can be a very effective mess. -
@srshah19 That says a lot about their temperament. They must have infinite patience. I wish I did.
-
srshah199968y@dfox must be the most zen person then ;) pushing updates in the middle of the night..
-
@bittersweet Yea, I use PHP 7 with Laravel on every freelance project I can.
But guess what??????? Every PHP information system that has been alive for at least 5 years (meaning it is ACTUALLY being used) is coded in PHPHUCKYOU 5.5.38 with ZEND FRAMEFUCKRK 2.6 and DOC[FUCK]TRINE 2; and needless to say they have over 1.2 MILLION untested line of code (since it was most likely coded by a script kiddie) with absolutely no possibility of being migrated since it has no architecture other than spitting random code in controllers; and a rewrite might take 1 or 2 years worth of actual business process analysis BUT DAT AINT HAPPENING RIGHT?
SO, BEING STUCK WITH PHP 5.5, I CANT WORK WITH AN ACTUAL COLLECTION CLASS; NOR WITH CONSISTENT APIs (check array_map, array_filter, array_reduce, etc. parameter order, u gotta re-check everytime).
BUT WAIT THERE IS MORE, IT LET YOU HAVE A CODEBASE FULL OF WARNINGS (TURNED OFF) SO I CAN'T PROPERLY DEBUG W/O DIE() ON EVERY 3 LINES OF....
*commits sudoku*
Related Rants
Thanks PHP for being the shittiest shit ever.
Sincerely,
FUCK YOU AND YOUR FUCKING FUCK FUCKSHIT
undefined
fuck you fuck
fuckshit