3 ms·
The advantages of CoffeeScript that TypeScript is lacking aren't mentioned. I wouldn't casually give up lightweight indentation-based syntax and optional parent
by barrkel 11y ago
The advantages of CoffeeScript that TypeScript is lacking aren't mentioned. I wouldn't casually give up lightweight indentation-based syntax and optional parentheses, despite the confusion both can cause. CoffeeScript makes it easy to create small DSLs that are fairly readable. Implicit hashes make for easy keyword-based arguments, only requiring '->' to make a value lazy is a bit better than () =>, and in particular not needing to end a big block of mixed code and data in a random mix of ")}]});" is a surprisingly big win, aesthetically.
- tallerholler 11y agoimo these (esp indentation) are why I don't plan on abandoning coffeescript any time soon.. es6 be damned!
- drumdance 11y agoSame here - indentation saves so much trouble. We have a coding style guide that covers things like when to use parentheses and when not.
- cristianpascu 11y agoThe first thought that came into mind when reading the article was: "We write bad code, the language is to blame". If all your variables are named "i", than yes, you have issues. If your code goes deeper and deeper in callbacks, it's not the language, it's you. No language on Earth will save you from that.
- eru 11y ago> If your code goes deeper and deeper in callbacks, it's not the language, it's you. No language on Earth will save you from that. You can do 20 layers of callbacks in Haskell without any problem. That's how Haskell does imperative blocks of code (ie monads).
- Retozi 11y agoI have written a full production application in CS before switching to JS and then eventually migrated to TS. I was one of the "you save characters, you gain readability" proponents as well (I love Python too). However, it is a terribly flawed argument. Typing characters is incredibly cheap. Debugging and refactoring in a dynamic language. However, is very time-consuming. You might be a tad slower writing Typescript (with autocompletion and typechecking, I doubt it though). But over the whole lifecycle of a codebase, Typescript is a lot faster for everything but very small projects. I have done refactors in Typescript in hours that would have taken me days in CS... multiple times. Additionally the human brain can adjust to predictable noise very well (brackets). After a training period, I find Javascript and Typescript almost as readable as MY Coffeescript. However, even when developing 8 hours for multiple months in Coffeescript, I always had a hard time to grok other people's Coffeescript. There is just too much freedom. This does not happen that easy with Javascript/Typescript. Generally, static typing in a complex user interface is a huge huge win productivity wise. While you type more characters, you are still faster over the lifecycle of a project. Hitting keys on your keyboard is literally the least time-consuming part of programming.
- stn 11y agoStatic typing doesn't have to require typing substantially more characters though (ML-family languages are good example, other examples I can think of is Nim), the syntax choice is quite orthogonal to this but it seems like C-syntax appears in new languages mostly due to its familiarity.