Re:TypeScript Seals My Penchant for JavaScript
by labrador on Friday September 30, 2016 @12:34AM
(#12610531)
Totally agree. After doing a bunch of code with TypeScript (transpiling to ES5 and ES3), I decided to give Babel a try. It took me awhile to set it up properly with the right presets and plugins. It did a fine job transpiling, but I wondered why people just don't use TypeScript. It's so much easier to use.
[ Parent
| on HN ]
Re:TypeScript Seals My Penchant for JavaScript
by marcus_holmes on Friday September 30, 2016 @01:05AM
(#12610605)
because I enjoy writing pure JS. Typescript feels like Coffeescript, which always felt like a hack to make Rubyists more comfortable. Similarly TS feels like a hack to make C#'ers more comfortable.
Ultimately, if you're going to program in JS then get comfortable in JS, rather than trying to make JS more like your favourite language.
Re:TypeScript Seals My Penchant for JavaScript
by addicted on Friday September 30, 2016 @02:53AM
(#12610866)
You can type absolutely pure JavaScript, change the file extension to .ts and still get some of the benefits of the typescript compiler for absolutely free.
That's probably why a lot of people are excited about typescript. It basically is JavaScript, but optionally annotated JavaScript. It's not a new language.
Re:TypeScript Seals My Penchant for JavaScript
by cies on Friday September 30, 2016 @08:55AM
(#12612147)
Not when using the billion-dollar-mistake-fixing `--strictNullChecks` flag. :)
Re:TypeScript Seals My Penchant for JavaScript
by labrador on Friday September 30, 2016 @01:09AM
(#12610611)
Some people like types, other people don't. Some people like indenting with 4 spaces, other like 2. I was a die hard 4 space guy until today, when I was debugging a bunch of 2 space code and decided I like it better.
Re:TypeScript Seals My Penchant for JavaScript
by wiredearp on Friday September 30, 2016 @04:48AM
(#12611251)
I have a solution for hardcoded spaces that is sure to blow your mind.
Re:TypeScript Seals My Penchant for JavaScript
by labrador on Friday September 30, 2016 @02:04PM
(#12614111)
8 charwidth tabs in Go are a sight to behold - what decade is this?
Re:TypeScript Seals My Penchant for JavaScript
by wiredearp on Friday September 30, 2016 @03:33PM
(#12614710)
Your editor will however default to 4 charwidth tabs, but you can change this whenever you feel like it and that's the point. It's just a setting, so we can all have our own and then we don't have to argue about it. This morning you like 2 spaces of indent because you can see more code; but this evening you like 8 spaces because the beer makes the code hard to see. It's true that the code appears locked to 8 spaces when you view it in a browser on GitHub (and that's basically why a majority of developers use spaces still in this decade) but you can also change this whenever you feel like it by placing an ".editorconfig" file in the root of your GitHub project, little known fact. In your case, you would simply change the tab width to 2 and then you don't have to commit all your files again and ruin it for everyone who prefers 4. Serious answer.