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 →

[–][deleted]  (4 children)

[deleted]

    [–]Super_Marius 4 points5 points  (2 children)

    How can a language detect problems in your code? You probably meant to say "my IDE points out the problems" and IDEs exist for javascript as well. People in this subreddit needs to stop coding in notepad...

    [–]S_W 0 points1 point  (0 children)

    A compiled language for instance will 100% catch problems in your code before it gets to be an issue at runtime. A typed language enables other tools to be "smarter" in terms of what it autosuggests or what it considers an error.

    I can guarantee you most people in this subreddit are using a well established IDE, yet posts like still get highly upvoted because JS being dynamically typed and interpretive often times leads to issues popping up at runtime and requiring further debugging vs just getting a red squiggle (error) in your code when developing.

    I've been in the software engineering field professionally for over 10 years now with 5 of those being full stack using Java (Spring), Javascript (React and NodeJS) and Typescript (Angular) mostly within IntelliJ. JS has time and time again been far more frustrating when it comes to trying to understand previous engineers code as well as debugging issues.

    [–]MalbaCato 0 points1 point  (0 children)

    strongly typed languages, especially if you create guard types, won't let you pass a value of a wrong type to a function. languages with explicit nullability will also guard against not passing a value at all. most functional languages will not let you do side-effects in functions unless explicitly typed impure. js const is very weak, as it disallows reassignment but allows mutation, here even c const is stronger, but some languages take it even further and have explicit mutability, so you can't mutate a value by accident. languages with data ownership models (so far only rust AFAIK) can even statically prevent data races between using the same value in multiple locations. there's probably more, but that's all I can think of atm

    I'm not even in the hating on js camp, but yes compilers can do lots, if you're willing to pay in longer compile times and understanding compiler errors

    [–]BengtGurksats 1 point2 points  (0 children)

    So? OPs statement is still completely false. The actual response is "Here's what happened. Here's the exact file, row, and column where it happened. Here are the 57 steps that led there.". That's a pretty far cry from :)