Live data from Hacker News

I Was Wrong About TypeScript

triplet.fi

51–60 of 194 posts

Re: I Was Wrong About TypeScript

#52
post #46

I see a lot of Angular comments, has anyone had good/bad experiences with TypeScript and React?

From a React newbies's perspective, the React community is much more in the es6 camp than Typescript. Many of the starter kits are in es6. It's not a huge deal.

I actually write most of my front-end code these days in Aurelia, which is written in es6, but they actually have type annotations which Babel knows how to deal with. So basically the tooling can auto-generate the *.d.ts files for you.

That said, Typescript natively supports React syntax through TSX files, which is nice.

Re: I Was Wrong About TypeScript

#53
post #46

I see a lot of Angular comments, has anyone had good/bad experiences with TypeScript and React?

My team uses it at work and love it. Both of them were new to me when I started (was using angular in vanilla JS) and it's been a really nice experience, the type definitions definitely help with learning a new codebase. I'm thinking of introducing typescript to my personal projects at home, but so far I've been too lazy to do the initial setup work.

Re: I Was Wrong About TypeScript

#54

Earlier quoted context omitted.

> As a Scala developer Interesting, choosing TypeScript over Scala.js; what does TS offer vs. working directly in Scala across the board?

As codablah said: the availability of type definitions is a major difference in ease of use. The other reason is that I can add a specialised frontend dev to the team and reasonably expect them to be able to work in Typescript.

Also, TypeScript uses a structural type system, which feels very dynamic most of the time.

I could imagine, that most JavaScript developers prefer this over nominative systems.

Re: I Was Wrong About TypeScript

#55

Ashamedly at one point I was on the anti-Angular 2 bandwagon due to Typescript, because Microsoft. When I started learning Angular 2 myself I've found I actually enjoyed working with Typescript, for many reasons. (confidence that my code wasn't a ball of mystery before it ran, using inline templates, succinctness of annotations, etc) At the same time, you're gonna need to use some preexisting libraries, and run into…

Ha, I'm on the anti-Angular2 bandwagon due to Angular1. I use React and Typescript and love it. Curious if you've tried React. Or Angular1

(TBH Angular1 was pretty great at the time, but after React I look back at those monstrous template files, ng-everything, plugins and workarounds, and only the bad memories surface).

Re: I Was Wrong About TypeScript

#56
post #20
post #4

Been using typescript since its introduction. It really helped me improve my JavaScript code quality and most importantly it's really good at keeping large projects tidy and easy to comprehend.

It would be interesting to hear more about your experiences. I have been quite hesitant to use more advanced TypeScript features and stayed on a type system related annotations.

Interestingly enough, the Typescript compiler team doesn't even use classes. If you want, you pretty much write just functional code.

Re: I Was Wrong About TypeScript

#57
post #37
post #30

As something of a side note on this post, suggesting there is a single 'Dart/CoffeeScript route' that languages can take seems a bit misleading. Dart is a whole different language that happens to be transpilable to JS. CoffeeScript is just a dash of syntactic sugar that (IMHO) makes JS a whole lot less tedious to write ('The golden rule of CoffeeScript is: "It's just JavaScript"'). Notwithstanding that, I am keen to…

Good point! I used similar categorising as Anders Hejlberg used in the JavaScript Jabber podcast ( https://devchat.tv/js-jabber/209-jsj-typescript-with-anders-... ). For those who don't like audio, he basically referred TypeScript being superset of JavaScript, unlike some other languages.

Somehow I can't stand listening to Hejlberg.

Often it feels like the CS professors I met at university, who wanted to teach you about "real programming languages and not such toys like JavaScript"

Re: I Was Wrong About TypeScript

#59
post #45

With the arrival of TS 2.0 this month (hopefully) we'll have some cool features: a union types [1] b type guards to work with them [1] c nonullable types [2] [1] https://www.typescriptlang.org/docs/handbook/advanced-types.... [2] https://github.com/Microsoft/TypeScript/pull/7140 As a Scala developer I like Typescript a lot. Which is a first for me in browser development. But I'm not so fond of webpack et al. So I cre…

TypeScript 1.8 already has unions and custom type guards! You can use them today. Woohoo! (Looking forward to those non-nullable types, though.)

I was just about to complain how TS fails totally for typechecking backbone models or immutablejs datastructures: both situations where obj.get("foo") and obj.get("bar") return a particular type but there's no way of having TS handle that except defining them as any. But it turns out string literal types in 1.8 will make that work. And this was out since February! I should reevaluate TS for my omniscient project.

Re: I Was Wrong About TypeScript

#60
post #19
post #7

I prefer frameworks that focus on pure javascript because the ones that don't tend to allow you too use javascript but have sparse documentation on how to use it effectively, instead focusing on typescript. When I first tried Angular 2 their javascript "hello world" example wouldn't even work, it was some bug in their site. I already need to use all sorts of other tools and abstraction layers when building websites/a…

3rd party libraries / frameworks written with non-JavaScript languages is worth another blog post and discussion. I agree completely with you that libraries / -most- frameworks should be written in plain old JS. The reason is simple, contributing and reading the project source code should not start by learning a programming language. It is a different scenario when a team in a company has decided to learn and write t…

ES2016 is already mostly compatible with major browsers - is it not?
Post reply on HN