Live data from Hacker News

I Was Wrong About TypeScript

triplet.fi

61–70 of 194 posts

Re: I Was Wrong About TypeScript

#61

Last week was my first week trying out Angular2 + TypeScript. I use mostly Java & C# at my day job. I was actually a really shocked at how fast i was able to gain a working knowledge of TypeScript. The only thing i don't like is my project has extra files everywhere (.js + .ts). However there is probably a way to make my IDE hide them or something.

I'd suggest using the --outDir option, so TS writes the .js files to a different directory which you can easily blow away.

Hey Rob any idea why VSCode gives this warning on export class for Components?

>[ts] Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

When using the angular-cli,

Re: I Was Wrong About TypeScript

#62
post #51

Anyone have feedback on using Flow vs TypeScript?

I'm also interested in this question.

Here's two things I saw on Jeff Morrison's (Flow author) Twitter:

* http://djcordhose.github.io/flow-vs-typescript/2016_hhjs.htm...

* https://gist.github.com/jeffmo/ef9214ca3acfe76c54a237b5710d3...

Re: I Was Wrong About TypeScript

#63
post #57
post #37

Earlier quoted context omitted.

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"

I can't go with that. Anders H is one of the most avuncular, helpful and accessible voices out there. Oh and his very verbs twinkle!

Re: I Was Wrong About TypeScript

#64
post #57

Earlier quoted context omitted.

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"

I can't go with that. Anders H is one of the most avuncular, helpful and accessible voices out there. Oh and his very verbs twinkle!

Well, I just saw a talk about TypeScript 2 and it felt to me that he was belittling JavaScript.

Re: I Was Wrong About TypeScript

#65

I just can't justify writing my team's code base in typescript. I don't want to make that move, setting us down a very specific path. I don't want to add another layer of training to develop on our codebase, but mainly, I just don't have the confidence that it's a right or wrong choice, and its a big choice. But I get a sense that it would be great to try for smaller, disposable projects as that's limited risk. Does…

The advantage of TypeScript is it emits idiomatic js. Decided that optional static typing is more trouble than it's worth? Fine. Bin your ts and keep the js. The code is totally fine. This is the attitude our team adopted when we first tried it out back in the 0.9 days. We didn't go back. You won't want to either

Re: I Was Wrong About TypeScript

#66
post #11
post #2

Having avoided typescript thus far, I really appreciated this take. Thank you for sharing it!

I am pleased to hear! One of the goals of the blog post was to convince people to give a second thought for the great tool.

It is fantastic - so glad you posted. On the transpilation thing; Babel still has a total use case. TypeScript doesn't provide es6 APIs such as Map / Promise / Array.find etc I output es6 from my TypeScript and pipe that into Babel to get the new APIs and to do transpilation. Works great. (There's a number of ways to do it; I use WebPack with ts-loader and babel-loader which rocks.)

Re: I Was Wrong About TypeScript

#67
post #32

The thing with 3rd party libs is, often there are no type defs, especially bleeding edge stuff :/ Also VSC often is flunky with picking up defs... sometimes you open a file and some are missing. Or imports with numbers don't work. On the other hand, using big libs like babylonjs is charming with all the auto complete :)

It's not a problem. You can resort to any type and works with 3rd party stuff like with normal JS code.

Re: I Was Wrong About TypeScript

#68

Earlier quoted context omitted.

I don't really work in the Javascript ecosystem, so when learning Angular 2 recently, I found all the other tools to carry far more cognitive load than Typescript.

> I found all the other tools to carry far more cognitive load What tools are you talking about?

System.js, Rx.js, decorators, ng2's DI - there's a lot of new concepts thrown in for the unfamiliar

Re: I Was Wrong About TypeScript

#69
post #3

Another good alternative is Facebook's flow. Rather than being a transpired language it works on top of JavaScript files. This two tools are amazing and it improves working with JavaScript to the point of never wanting to go back to not typed JavaScript

Well, you still need some transpiling in order to remove the Flow type signatures. In practice, they end up being pretty similar in terms of needing a build step.

Re: I Was Wrong About TypeScript

#70

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…

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

I think the biggest advantage is that typescript emits code that is good JavaScript. This means if I decide to stop using typescript, I can just use the generated JavaScript. It also means that there transpiled file is smaller. Using scala.js for a small project wouldn't make sense if you cared about file size at all. It could be worth it more as your project grows, but your then you are that much more commited. There's no exit strategy like with typescript.
Post reply on HN