Mutahar is a fucking moron.
- 0 Posts
- 10 Comments
Fair enough. This is why people prefer typescript
Use typescript if you’re paranoid about this
This is fair enough from an idealistic view. In practice, you don’t want your entire website to shit itself because of a potentially insignificant error.
Depends on the resources required and how much benefit it brings to the average user.
To start off… Using arithmetic operators on strings in combination with integers is a pure skill issue. Let’s disregard this.
If you were to use + where one part is a string, it’s natural to assume a string appending is desired since + is commonly used as a function for this. On the other hand, - is never used for any string operation. Therefore, it’s safe to assume that it relates to actual artihmetics and any strings should therefore be converted to numerical values.
This is an issue with untyped languages. If you don’t like it, use typescript. End of story.
What if the documentation is wrong?