4 ms·
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
by labrador 10y ago
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.
- marcus_holmes 10y agobecause 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.
- labrador 10y agoSome 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.
- wiredearp 10y agoI have a solution for hardcoded spaces that is sure to blow your mind.
- labrador 10y ago8 charwidth tabs in Go are a sight to behold - what decade is this?
- wiredearp 10y agoYour 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.
- addicted 10y agoYou 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.
- cies 10y agoNot when using the billion-dollar-mistake-fixing `--strictNullChecks` flag. :)