r/javascript • • Mar 02 '19

Useful javascript one-liners.

https://medium.com/@smellycode/js-one-liners-8bc0a6af2345?source=friends_link&sk=a9295a05aef9e514e137fca7eeb89cd1
344 Upvotes

96 comments sorted by

View all comments

43

u/Shaper_pmp Mar 02 '19

Why on earth would anyone use a font for programming that runs characters together and makes it difficult or impossible to determine whether something is a double- or triple-equals?

With a language like JS that's just asking for trouble...

1

u/izuriel Mar 03 '19

It takes time to get familiarized with it, I’ll give you that. But IMO in the long run it enhances readability*.

As has been stated already triple equals has three bars vs two for double equals. Very distiguishable. Also not equals has a line through making it stand out as well. There are some ligatures I’m not as much a fan of (like less equal and greater equal being angled). For symbol heavy languages like Haskell this is a massive boost in readability there given the symbols used.

  • there are some odd cases in languages where symbol combinations are nonstandard and fall apart with ligatures.