56 points theanonymousone 3 days ago 13 comments
austin-cheney 3 hours ago | parent
White space characters are challenging to differentiate in human readable text, but JavaScript makes that perfectly clear to humans by splitting a string on every character, which is helpful for debugging.
_def 1 hour ago | parent
The odd one out above is NEXT LINE (U+0085). Unicode explicitly includes it in White_Space, and Python accepts it too, but JavaScript doesn't. Instead, JavaScript recognises ZERO WIDTH NO-BREAK SPACE (U+FEFF), which Unicode doesn't include in the set.adornKey 3 hours ago | parent
LoganDark 2 hours ago | parent
tjoff 1 hour ago | parent
What turns into whitespace due to rendering? Just because my font lacks that symbol doesn't mean it is whitespace.
LoganDark 48 minutes ago | parent
tjoff 37 minutes ago | parent
efilife 2 hours ago | parent
usrnm 1 hour ago | parent
SerCe 1 hour ago | parent
lelanthran 23 minutes ago | parent
It's a perfect hash (i.e. no collisions) that hash to an entry in a 32-element array.
Very similar to how we usually do quick lookups of strings for `switch()` statements: https://github.com/lelanthran/libxtree/blob/878cb4fc11ffd617...
smallstepforman 1 hour ago | parent
Should have got guys that grew up with the 8-bit micros to write up a spec.
pixelbeat__ 1 hour ago | parent
Have a look at how GNU coreutils classifies each type of spacing (in a cross platform consistent way) at https://github.com/coreutils/coreutils/blob/master/src%2Fsys...