7 ms·
It's been 10 years since "PHP: a fractal of bad design" [1] was written. It's remarkable how the language evolved, and how many of the issues mentioned have be
by shaicoleman 4y ago
It's been 10 years since "PHP: a fractal of bad design" [1] was written.
It's remarkable how the language evolved, and how many of the issues mentioned have been fixed and improved over the last ten years.
1. https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- archerx 4y agoIt’s funny because when I think of “fractal of bad design”, Javascript is the first thing that comes to mind. I love Javascript but it makes me ask “why?” a lot.
- dubcanada 4y agoPHP is kind of the same league, a lot of hate comes because some senior employee told a bunch of juniors after years of working in Wordpress that PHP is a garbage language and you should not touch it. "It's cool to hate PHP!" PHP can make absolute garbage, and it can make a elegant product. Just like Javascript can. And same with Python and Ruby and what ever else everyone recommends. It may be a lot harder to make garbage in Rust, but it's possible. PHP has a problem where it gets out of your way, gives you the entire toolbox to build a house. But the problem is which one of the 17 types of hammers do I use to hammer in one of the 104 different types of nails. Where as Ruby, gives you 3 hammers and 4 different nails, and 7 magic nails that appear after you're done hammering.
- awestroke 4y agoJust use typescript
- archerx 4y agoNo.
- azangru 4y agoPhp's inconsistencies in regards to needle vs haystack make me weep. Javascript doesn't have anything remotely like that.
- lordgroff 4y agoI hope you realize that "fixing" these types of early mistakes is almost impossible for PHP, a language which tries hard not to break things, especially something that's going to be used everywhere. But if this is such a deal-breaker and your IDE is dumb as a stump and can't remind you nothing prevents you from wrapping the stdlib or using something like psl to do it for you.
- azangru 4y ago> I hope you realize that "fixing" these types of early mistakes is almost impossible for PHP I do, yes; which means early mistakes stay in the language forever; same as in javascript. More's the pity.
- unity1001 4y agoIf its powering 80% of the internet, 30% of all ecommerce websites, its not a mistake.
- iLoveOncall 4y agoI think fixing as in "removing and replacing" is indeed impossible, but defining a new convention and making alternative names for the same function would work fine. Let's say the new convention is that functions are named str_*(), then keep strpos(), but create a new one called str_pos() that is the same, and mark the old one as deprecated (but don't remove it). I am sure there are edge cases where both str_* and str* exist already and do different things, but we can figure something out.
- dbbk 4y agoI think you actually could fix this forward by using named arguments instead of positional ones?
- abujazar 4y agoMany of the statements in that article were misleading or outdated already in 2012, though. E.g. the part about PHP being tied to Apache… At that time I had been using php-fpm behind nginx for years.
- awestroke 4y agoWhich ones have been fixed?
- makeitdouble 4y agoI didn’t go back to all the points, but I get the feeling the configuration and security parts are mostly fixed, while the functions related issues and type looseness stayed mostly the same. Am I missing other important parts ?