Re:JavaScript's world domination
by TazeTSchnitzel on Tuesday March 24, 2015 @08:53PM
(#9260616)
To be fair, the + issue is a mistake many other languages have made too. Incredibly, PHP, poster child of bad languages, gets this right and splits + and . (though this may just be because it copied Perl).
[ Parent
| on HN ]
It's fine to have a (string) + (string) operator, it's just generally a less than brilliant idea to have a (string) + (arbitrary) operator that does an implicit string conversion.
But all of that's fine compared to PHP's implicit number conversion that ignores trailing characters, presumably so that you can add "3 onions" to "1 kg of bacon" or some such...
Re:JavaScript's world domination
by TazeTSchnitzel on Wednesday March 25, 2015 @10:51PM
(#9267533)
(string) + (string) isn't fine either, if only for performance reasons and because an operator should just do one thing.