Skip to content

Comment on Strangest Programming Language Feature?parent

Comments

I guess that is because coffeescript's <= operator is just javascript's <= operator, which does implicit type conversion.

but coffeescript's "is", aka ==, aka === in javascript, doesn't.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

having "==" be semantically quite different to "<=" doesn't seem a particularly nice choice of notation.

arguably coffeescript has made things worse in this case compared to plain javascript, where you're probably not going to expect === to behave similarly to <=.

not obvious how you'd improve this to make it consistent, without say redefining how "==" and "<=" work to make them raise type errors or evaluate to something undefined if the types of the arguments don't match.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.