Lemminary

joined 2 years ago
[โ€“] Lemminary@lemmy.world 1 points 1 hour ago

Erm, yes? Been programing for 15 years, I think I know my way around. ๐Ÿ˜…

[โ€“] Lemminary@lemmy.world 2 points 3 hours ago (2 children)
[โ€“] Lemminary@lemmy.world 1 points 12 hours ago

Not wrong, but funnily enough, it's a linting rule win. I'd go nuts if I didn't have my type checks and my linters. My current L, though, is setting up the projects initially and dealing with the configuration files if I raw dog it, but that's a problem with ESLint configs and the ecosystem as a whole having to deal with those headaches. So in the end, the JS devs got clever and shifted the blame to the tooling. ๐Ÿ˜…

[โ€“] Lemminary@lemmy.world 2 points 17 hours ago (4 children)

There are dozens of us! But also, I have a masochistic tendency to update my old code to use the new language features and make it somewhat readable.

[โ€“] Lemminary@lemmy.world 3 points 18 hours ago

Same here. My brain interprets them as one long run-on sentence and throws a parsing error.

[โ€“] Lemminary@lemmy.world 9 points 18 hours ago* (last edited 18 hours ago) (3 children)

Explanation for nerdsThe reason is the JS compiler removes whitespace and introduces semicolons only "where necessary".

So writing

function myFn() {
  return true;
}

Is not the same as

function myFn() {
  return 
    true;
}

Because the compiler will see that and make it:

function myFn() { return; true; }

You big ol' nerd. Tee-hee.

[โ€“] Lemminary@lemmy.world 21 points 22 hours ago (9 children)

That's TypeScript. I can tell by the pixels defining a type above.