Comment

Comment by dumael

As a compiler developer I honestly shudder reading this. From the last example:

> $ node

> "5" + "1"

> '51'

> "5" - "1"

> 4

How is this in anyway reasonable behavior? '+' is string concatenation but '-' is interpret these strings as numbers and perform arithmetic?

Does the principle of least surprise apply here?

parent dumael 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton