3 ms·
>> There was never anything wrong with PHP, really. I mean, your listed points are arguably correct, but this sentence is quite incorrect. edit: downvoted by
by enraged_camel 7y ago
>> There was never anything wrong with PHP, really.
I mean, your listed points are arguably correct, but this sentence is quite incorrect.
edit: downvoted by PHP fans. It's OK, I get it, nobody likes it when others dunk on their favorite language. :)
- wk_end 7y agoYou were downvoted because your post lacked any real content or rebuttal (and, probably, for the edit - no one likes it when people complain about downvotes). FWIW though, you're absolutely right - there was (maybe still is?) an enormous amount wrong with PHP. The only real rebuttal core-questions needs is a link to the classic essay, "PHP: a fractal of bad design" [1], which lists far, far more problems than just issues with function names or parameter order, and does it more comprehensively and with more style than you or I could hope to. [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/
- arkh 7y agoOne I always like is people using "mysql_real_escape_string". Well guess what? It comes from mysql itself: https://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-string.html https://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-st...
- johannes1234321 7y agoLots of "classic" PHP is just thin wrappers of C libraries. Many of the inconsistencies in PHP come from being consistent with those libraries.
- tambourine_man 7y agoNot really. You may be surprised to learn, as I was, that PHP function hashing mechanism was strlen() in the beginning. So the number of characters was more important than naming consistency. https://news-web.php.net/php.internals/70691 https://news-web.php.net/php.internals/70691
- johannes1234321 7y agoThat is for function with no C counterparts. htmlspecialchars() exists in no common C library. The reason strlen() is called strlen() (not string_length() or length() or whatever) however is due to C.
- lioeters 7y agoYes, I was shocked to learn this about early PHP, that function names were hashed simply by their lengths - so names were chosen to fit a specific length. Pragmatic and fast? Yes. Insane design? Completely. Edit: I can also imagine this design decision must have had context. Perhaps it was a common technique in low-level programming, as a practical way to save time/space.
- johannes1234321 7y agoGiven the amount of functions in early PHP (we are talking PHP/FI 2 max here, even userlevel code hardly had functions back then) even not hashing them at all, but doing a linear search over the function table would have been acceptable. Hashing by length most likely lead to few buckets with more than 3 functions.
- Piskvorrr 7y agoA "classic" is timeless (cf. Reflections on trusting trust, published in 1984). This essay used to be spot on; with age, it didn't become classic, it went the other route and became obsolete (as it was rightfully critiquing PHP 5.3).
- wk_end 7y agoIf this is a way of advancing the case that PHP is no longer bad, well, sure. I allowed for that, it may be true, I can’t say. We were discussing whether it was ever bad, which it clearly was. But sure. On the other hand, if you’re trying to nerd-snipe me into a debate over the meaning of the word “classic”... :) I’ve gotta disagree with your characterization. At least in the field of jeremiads, surely the criteria can’t solely be timelessness - that’d imply that an essay that successfully inspires change couldn’t be a classic (not that that’s what happened here, I’m not directly attributing anything to anyone). Words are hard to pin down, but I think when it comes to screeds, what’s “classic” could be, in fact, whether it provoked some kind of change - if at the time it won hearts and minds. Or, what’s “classic” could be not necessarily about the specific thing it’s arguing against, but instead about the underlying principles guiding that argument. Or maybe it’s about the style, panache, humour, or clarity with which those principles are argued. Maybe some combination of all of the above. No one programs with gotos much anymore, but “Go To Statement Considered Harmful” is probably safe to call a classic. America is an independent nation and King George no longer holds the British throne, but nevertheless the Declaration of Independence is certainly a classic text. For reasons of style, persuasiveness, its underlying principles (I think anyone designing a PL should have read it), and its widespread popularity and influence at the time it was written, I think the PHP essay counts as a classic too. YMMV.
- toxican 7y agoDunk? What you've done is stood on the other end of the court, holding the ball and said "I can dunk this ball" then left the court. If you've got some counterpoints or arguments, please give them. Going "lol php bad" is just dumb.