Making the Most of the JavaScript Language (2016)
thenorthcode.net
Making the Most of the JavaScript Language (2016)
1–10 of 47 posts
Re: Making the Most of the JavaScript Language (2016)
#2The "use a more functional approach" and "take advantage of ES6" are by far the biggest for me. ES6 added so much good stuff, I wouldn't consider it optional. It's better than incremental upgrades, feels almost like a different language to me.
Every language has its quirks, and while I'll keep on hating Javascript's, I'll never lose sight of the fact that if you're holding out for the perfect language, you're not going to be doing much coding.
Re: Making the Most of the JavaScript Language (2016)
#3Re: Making the Most of the JavaScript Language (2016)
#4What I can't recommend enough (and hinted at in the article) is for someone to use a transpiler like Babel (and core-js, babel-preset-env, and etc). There's no reason not to use many of the new features and new functions of ES2015+, and you can do that right now even if you're targeting old browsers with transpilation and a bit of automatic shimming.
Re: Making the Most of the JavaScript Language (2016)
#5Re: Making the Most of the JavaScript Language (2016)
#6What I can't recommend enough (and hinted at in the article) is for someone to use a transpiler like Babel (and core-js, babel-preset-env, and etc). There's no reason not to use many of the new features and new functions of ES2015+, and you can do that right now even if you're targeting old browsers with transpilation and a bit of automatic shimming.
Transpilation is wonderful but it does add a lot of complexity to the build chain. I'm with you the language features are worth it but it's just a quirk of developing for browsers that they don't move as fast as JS itself and that all of this extra machinery is necessary.
They made a real focus on tooling and it's been widely adopted.
In intellij it's as simple as turning on the option and creating a .ts file, the identically named js file is then dropped in the same directory (by default) and you just include that.
It's about 2 minutes from start to finish to setup.
Then it's a natural progression to using https://www.typescriptlang.org/docs/handbook/tsconfig-json.h...
I mean sure if you are going with a split bundle, hot code reloading and tree shaking via webpack then there is a high start cost but ts on it's own is rather fantastic.
vscode does the same thing as intellij if you want to try it without downloading intellij.
Re: Making the Most of the JavaScript Language (2016)
#7As someone who works with this every day, I'd say this is pretty solid advice. The "use a more functional approach" and "take advantage of ES6" are by far the biggest for me. ES6 added so much good stuff, I wouldn't consider it optional. It's better than incremental upgrades, feels almost like a different language to me. Every language has its quirks, and while I'll keep on hating Javascript's, I'll never lose sight…
The only transpiler I've seen that gets close in terms of quality of output is BuckleScript, that thing is damn near magic but TS has the momentum and adoption.
TypeScript has been so good and caused me so few problems that I actually look at ways of moving more bits to the frontend, it makes it pleasant to work and I think (personally) the highest praise you can give a language is that it's pleasant.
Re: Making the Most of the JavaScript Language (2016)
#8What I can't recommend enough (and hinted at in the article) is for someone to use a transpiler like Babel (and core-js, babel-preset-env, and etc). There's no reason not to use many of the new features and new functions of ES2015+, and you can do that right now even if you're targeting old browsers with transpilation and a bit of automatic shimming.
Re: Making the Most of the JavaScript Language (2016)
#9What I can't recommend enough (and hinted at in the article) is for someone to use a transpiler like Babel (and core-js, babel-preset-env, and etc). There's no reason not to use many of the new features and new functions of ES2015+, and you can do that right now even if you're targeting old browsers with transpilation and a bit of automatic shimming.
How does debugging in the browser console work when you use that approach?
Thus in your browser you see the code you write, you put in breakpoints as desired, and everything generally works.
I don't have much depth as to how it all works behind the scenes though, I'd love to know more.