4 ms·
Is TypeScript as annoying a language to code in as Javascript? Or is it comparable to other modern languages like Swift and Go? If it is, I'd say that pain of d
by kartickv 10y ago
Is TypeScript as annoying a language to code in as Javascript? Or is it comparable to other modern languages like Swift and Go? If it is, I'd say that pain of dealing with Javascript (for developer productivity and happiness) is already taken care of.
- bluejekyll 10y agoBut webassembly will allow for typescript or you language of choice, c/c++ and rust first, and as the OP suggests others too.
- kartickv 10y agoThe question was whether the concern of JS being frustrating is already solved by TypeScript, in which case WebAssembly is less important than it would be otherwise. (Which isn't to say that there aren't other questions like efficiency and already-existing codebases written in other languages.)
- Clubber 10y agoTypescript is a type safe language that "compiles" into javascript. The Microsoft implementation compiles on save, so you work in your file.ts and a program running somewhere fires when the file is saved and converts it to file.js which you would distribute. I haven't used it yet, but the demo from Anders looked good. It's an attempt to fix the "loosey goosey" nature of javascript. I would be great if browsers supported it as a built in language. https://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript https://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing... If you watch the video, you'll notice the argument notation is name: type rather than type name. I think Anders is reminiscing about his Delphi days.
- TAForObvReasons 10y ago> If you watch the video, you'll notice the argument notation is name: type rather than type name. I think Anders is reminiscing about his Delphi days. ActionScript and the proposed ECMAScript 4 also use the name:type notation, so there is definitely some prior art in the web sphere
- kayoone 10y agoThats not really what he asked though. If in the end a developer can work 98% in TS, do they really care if it runs as JS or something else if it solves their problems with the language ? I have heard from people that love TS, but surprisingly many that also prefer pure ES6 JS.
- Clubber 10y agoThe only concerns I would have is I believe you have to debug the javascript rather than the typescript.
- thomasrognon 10y agoYou can make the sourcemaps refer to the TypeScript code. I set breakpoints in TypeScript files and step through it all the time.
- JamesBarney 10y agoYou should think of typescript as javascript+ more than a different language. It looks more like what javascript would look like in 2-3 version if the governing body thought static types were important to add.
- kartickv 10y agoThat doesn't answer my question of whether TypeScript solves the concern of JS being frustrating to work in.
- charlieflowers 10y agoTypeScript is a joy to program in. I was on a project where we had the opportunity to turn on all the strict checks (no use of any, no implicit nulls, etc.), and it was super enjoyable and efficient to program in. You have algebraic types (well, 99%), union types, and concise ways of expressing tree types. I would imagine it is more pleasant than Swift or Go, though I haven't used either of those very much.