News for hackers. Stuff that matters.
Re:Announcing TypeScript 2.1 by g00gler on Wednesday December 07, 2016 @01:01PM (#13124583)
I have to second Mr.timruffles. After using TS in a couple of projects I grew to miss it when I couldn't use it.

If you don't like the C#-ness of Typescript, try using Facebook's flow. Typing isn't a magic bullet, typescript isn't even type safe, but it sure makes development easier and your apps more stable.

Re:Announcing TypeScript 2.1 by eklavya on Wednesday December 07, 2016 @01:14PM (#13124722)
"Typing isn't a magic bullet, ..., but it sure makes development easier and your apps more stable."

That right there is the whole essence of typed programming :)

Re:Announcing TypeScript 2.1 by stcredzero on Wednesday December 07, 2016 @02:02PM (#13125177)
Going one level deeper, the underlying truism is that computers make better bean counters than people, even programmers. Type systems are good insofar as they free up cognitive resources of the programmer. Conversely, type systems are bad when they make programmers burn attention resources without enough return. (This is a difficult thing for people to evaluate, because sometimes the "return" from a type system can pay off many years later.)

Again, it all comes down to cost-benefit. A new, modern 21st century language should be designed with the above in mind. The type system should make the resulting apps more stable, stay out of the way of coders reading code and writing new code, yet enable powerful tooling that doesn't need a heavyweight background process running a O(n^4) algorithm to collate meta-level information to enable all the IDE features. (Ideally, the tooling should be able to parse everything it needs to parse at some small multiple of the time it takes to read the source files off the drive.)

Again, it's all about cost-benefit! "Elegance" or popularity with tech hipsters be damned, what's the cost, and what does it get you? (The nickel-and-dime costs of waiting around for lugubrious and unresponsive tools not only add up, they operate with some huge multiplier effect.)

Re:Announcing TypeScript 2.1 by sjwright on Thursday December 08, 2016 @12:23AM (#13128587)
In my opinion, the critical aspect of typed code is the ability to declare a variable as either a number, string or binary. Let me declare this up front, let the compiler enforce it, and my mind is freed from semi-paranoid concerns about edge cases and spurious inputs.

But sometimes I don't care exactly what sort of number is used. This is where many type systems go overboard, by forcing me pick a 64 bit unsigned integer or whatever.

Re:Announcing TypeScript 2.1 by boubiyeah on Wednesday December 07, 2016 @04:10PM (#13126244)
The thing is, you don't have to use the C#-ness of typescript. typescript started like that and I disliked it at first, but it's now very good at typing an entire codebase using mostly a functional programming style. flow is unfortunately way behind in terms of robustness and IDE support.
Re:Announcing TypeScript 2.1 by RyanCavanaugh on Wednesday December 07, 2016 @02:13PM (#13125269)
Where do you perceive the C#-ness of TS coming from? TS and Flow are ~90% identical (most programs accepted by one would be accepted by the other) and TS adds only a few purely optional syntactic features (namespace, enum) that are widely found in other languages.
Re:Announcing TypeScript 2.1 by g00gler on Thursday December 08, 2016 @12:44PM (#13132255)
* Disclaimer: Correct me if I'm wrong, I haven't used flow extensively but I did check the docs.

One big thing is TypeScript classes are entirely different than standard JS classes. I guess you don't have to use them but it adds Abstract classes, interfaces and access control (eg private, protected vars).

Re:Announcing TypeScript 2.1 by gokhan on Wednesday December 07, 2016 @02:43PM (#13125541)
Might be referring to <T> or var smt = new Smt(); or the use of ? etc.
Re:Announcing TypeScript 2.1 by thejameskyle on Wednesday December 07, 2016 @02:53PM (#13125630)
Those all exist in Flow as well.

I assume the original poster is talking about how few types you actually need to write in Flow because of how good the inference is.

Re:Announcing TypeScript 2.1 by boubiyeah on Wednesday December 07, 2016 @05:34PM (#13126900)
Nowadays, typescript inference is not any worse than Flow's though.