News for hackers. Stuff that matters.
Re:Why does ++[[]][+[]]+[+[]] return the string "10"? by wruza on Tuesday October 08, 2024 @12:38PM (#41779195)
There are levels to this. You can make it harder by forcing them to adhere to some boilerplate protocols and quirky patterns and you can make [0] behave as 0. The former is a barrier, the latter is an unnecessary toy that actually messes with beginners. This idea was wrong not because beginners shouldn’t program. It’s wrong cause it makes the road unnecessarily bumpy for everyone. If you have ([T] | T) in your api, which actually was the reason for it, iirc, just make a function toT() that returns T either way.

There are no comments on this comment yet.