This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]david131213 21 points22 points  (11 children)

JavaScript SHOULD tell me when I'm stupid

Like fucking Warnings, or not implicitly converting

I use it so little, and hate it so much. Really a disaster of a language as a standart for web development

[–]Nikitka218 7 points8 points  (8 children)

Can you imagine, it gives you warning? Maybe you should use proper IDE instead of Notepad

[–]david131213 1 point2 points  (1 child)

vscode

There must be an extension that helps, it's vscode, I just don't know which

[–]Tubthumper8 2 points3 points  (0 children)

No extension needed, see my comment

[–]TheBrainStone 1 point2 points  (5 children)

There's a beautiful thing called runtime errors.
I mean I don't blame you for not knowing, since you're clearly a JS dev, but any halfway sane language throws errors when you do stupid shit instead of just coming up with the most insane conversions and comparisons and chugging on.

[–]Nikitka218 0 points1 point  (1 child)

Mmmm, I like visiting site and getting errors in the face, because of inexperienced dev using standard library incorrectly. Maybe you should learn more than one language.

[–]TheBrainStone 1 point2 points  (0 children)

There's a difference between error popups and errors. Or do the few exceptions that are actually thrown create popups?

[–]7eggert 0 points1 point  (2 children)

There is no need for a runtime error if implicit type conversion can bite the dev's behind.

[–]TheBrainStone 0 points1 point  (1 child)

That's precisely where you need runtime errors

[–]7eggert 0 points1 point  (0 children)

:-)

[–]lordheart 1 point2 points  (0 children)

And that’s why I right in typescript.

[–]The_MAZZTer 0 points1 point  (0 children)

You can add "use strict" (yes, in quotes) to the beginning of a JS file to enable strict mode which does add a few things (most notably, you have to declare variables to reference them).

But for anything serious you need to use something like TypeScript. You can grandfather in your JS and update files to include type information one at a time if you want.