News for hackers. Stuff that matters.
Re:Goodbye CoffeeScript, Hello TypeScript by barrkel on Tuesday October 20, 2015 @01:56PM (#10420671)
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.
Re:Goodbye CoffeeScript, Hello TypeScript by Retozi on Tuesday October 20, 2015 @05:36PM (#10421981)
I 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.

Re:Goodbye CoffeeScript, Hello TypeScript by stn on Wednesday October 21, 2015 @07:42AM (#10424789)
Static 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.
Re:Goodbye CoffeeScript, Hello TypeScript by cristianpascu on Tuesday October 20, 2015 @03:54PM (#10421397)
The 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.
Re:Goodbye CoffeeScript, Hello TypeScript by eru on Tuesday October 20, 2015 @09:57PM (#10423135)
> 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).

Re:Goodbye CoffeeScript, Hello TypeScript by tallerholler on Tuesday October 20, 2015 @02:33PM (#10420880)
imo these (esp indentation) are why I don't plan on abandoning coffeescript any time soon.. es6 be damned!
Re:Goodbye CoffeeScript, Hello TypeScript by drumdance on Tuesday October 20, 2015 @02:52PM (#10421009)
Same here - indentation saves so much trouble. We have a coding style guide that covers things like when to use parentheses and when not.