4 ms·
PHP Sadness
- bell-cot 3y agoLooks like it was partly updated in 2018. Tempting to flag - but HN's FAQ doesn't mention "reasonably up-to-date" anywhere, so...
- unethical_ban 3y agoShould at least say 2018 but fine otherwise.
- 65 3y agoMy biggest PHP pet peeve has always been that the arguments are switched in the array_map and array_filter functions. array_map takes the callback first while array_filter takes the array first. I understand that array_filter takes the array first so you don't have to pass a callback if you just want to filter out empty values, but they could have designed these functions more consistently. I forget which argument comes first when using these functions all the time.
- willio58 3y agoYeah sometimes the little details can make or break a language or at least its popularity
- yurishimo 3y agoHonestly, this is why I use some version of the “Collection” class that is popular in most frameworks. Normalization for array and string functions is huge for reducing some cognitive load. Would it be nice if this was built in? Of course, but until then, I’ll take all the help I can get.
- bawolff 3y agoIs it just me, but do some of these seem like pretty minor issues. Like requiring semi-colons at the end of a block. Really?
- yetanother12345 3y agominor issues. Not even annoyances. And old hat on top (even long solved issues are kept here just to make the list appear longer). If you really want to find faults you can, everywhere. These are all items that an experienced PHP dev will sort out, optionally work around, and really not care much about. It's fair to suggest optimizations and improvements, but plainly exhibiting incompetence leads nowhere. Some examples, like, say " explode() function won't split with empty string" ... seems very sought after/constructed, too. This behaviour is simply not using the function as intended, because it needs a delimiter to, well, delimit. There are other means to split any random string into random chunks. Indeed there are other means to do most things in PHP.
- yurishimo 3y agoWhat is the point in this post here on HN? Old languages have tech debt too. We can acknowledge “bad” parts of languages but I’m not sure what the point of this post is, other than to foment and encourage conflict. Someone post the “JS bad” blogs again for the people in the back.
- 1shooner 3y agoI'm not going to step through how many of these still apply, but this link hasn't been updated in 5 years and is referring to a version of the language discontinued over a year ago.
- bdcravens 3y agoThe first item in the list, the T_PAAMAYIM_NEKUDOTAYIM error message, doesn't say anything about why the error is referenced that way. That's Hebrew for "::". The idea of using languages other than English to describe things is a big topic in itself, but to read the entry you'd think it was just nonsense letters. http://phpsadness.com/sad/1 http://phpsadness.com/sad/1
- bawolff 3y agoNames are usually pretty arbitrary. Lots of languages have a "spaceship operator" but i would have no idea what it means if i didn't have it memorized.
- LordShredda 3y agoThey're not that arbitrary, evidenced by how if you have all keywords in English, then throw a latinized non English word in and people get confuses.