4 ms·
You can easily test your Coffeescript code with a dynamic type checker and be perfectly type safe, even at runtime! Why for gods sake convert your code base to
by deanmkenzey 6y ago
You can easily test your Coffeescript code with a dynamic type checker and be perfectly type safe, even at runtime! Why for gods sake convert your code base to another language primarily for imaginary type safety?
But for some strange reason entire armies of developers move to Microsoft's Typescript, living their imaginary type save dream. Moving from a language as Coffeecript to Typescript is like dropping at least 25% of your productivity. Not only you'll have to write more code, which in itself increases the chance for bugs, but you'll also be fighting countless compiler issues, installing numerous @types modules, having intellectual discussions about types and whatsoever to make it 'kind of work'. Oh, and almost none of the TS code bases I've seen are without the 'any' keyword, which is actually an instant breach of your type safe haven. IMAO 'any' should never pass a code review in a Typescript project if you want to stay true to your religion. With such a strict regime, like you are forced to with real strictly typed languages, would completely eliminate TS. Without 'any' it's practically impossible to write a large code base with it.
I wrote numerous relatively bug free applications in Coffeescript, small and large as well. Just do good testing and you'll be fine, and as a bonus you'll have type safety at runtime! The mine field is not types IMAO, there is so much more to high quality code bases.
- matchbok 6y agoUsing 'any' is perfectly fine, you just don't understand how most companies use TS.
- deanmkenzey 6y agoNot using 'any' is also perfectly fine, as you can with Javascript, Python, Ruby, etc.. And I guess that most companies just don't understand how I use Coffeescript. Besides, I am not against others using Typescript, it's a fun experiment and a great opportunity for front-end developers to learn about static typing, enjoy it if you can! For me it unfortunately doesn't work, I've never gained from it because I generally don't have type issues. It's a pain in the ass that's constantly bugging me, pulling me out of the flow. It's a monster of a tool that tries to solve a problem I don't have.
- jondubois 6y agoI agree that types don't add any value for most experienced developers but I don't understand why use CoffeeScript instead of plain JavaScript... Just a few more lines doesn't hurt and you save yourself from having a compulsory build step, dealing with source maps and dealing with transpiler version compatibility issues.
- deanmkenzey 6y ago> I don't understand why use CoffeeScript instead of plain JavaScript I didn't say I don't use plain JS today, I do! And indeed for the exact same reasons you mention :)
- jondubois 6y agoGood to know other people on HN also feel that way. To me TypeScript feels almost like a conspiracy. I just don't get it. I've always been ahead of the trend with ECMAScript/JavaScript (started seriously coding with it in 2004 while I was still in high school), NoSQL databases, Node.js, Angular, Vue.JS, but I couldn't imagine TypeScript becoming so popular (though I had found out about it very early). I still can't make sense of it. I've spoken with some well known bloggers who've admitted to me that they don't like it but they wouldn't admit this publicly right now because it has too much traction.