Re:A look at modern PHP
by Apofis on Tuesday May 05, 2020 @11:36AM
(#23081160)
Sounds like a jr dev misstep... you're not really bringing up any key points.
[ Parent
| on HN ]
It takes 5 seconds on Google to find a myriad complaints about weird, unexpected, and downright incorrect things that PHP does. That wasn't the point of my reply. The point was that language choice CAN affect productivity. And having a bunch of gotchas is something that will negatively affect productivity. I simply gave the first example that popped into my head that actually tripped me up.
Re:A look at modern PHP
by Supermancho on Tuesday May 05, 2020 @01:43PM
(#23082651)
Unit tests would have caught this, if you wrote them.
Assuming you thought to test using a string that's all digits. You have to know about PHP's brokenness to even think to check that. In a sane language, it doesn't matter what the contents of the strings are, they're just strings.
>Unit tests would have caught this, if you wrote them.
If I hadn't considered string-number-keys in my code, I would also have forgotten about them in my unit tests. Maybe you're different.