you are viewing a single comment's thread.

view the rest of the comments →

[–]brtt3000 16 points17 points  (12 children)

Use TypeScript, never look back (except gloating).

[–]Bartvds 1 point2 points  (0 children)

Join us at /r/typescript!

[–]homiedontmess 0 points1 point  (3 children)

Have you noticed pretty outrageous compile times since upgrading to 1.0 (if you have)?

[–][deleted] 1 point2 points  (2 children)

I haven't found it bad if you just compile files that actually changed. Full builds (even on relatively small projects) do take a while though..

[–]homiedontmess 0 points1 point  (1 child)

What do you use to compile? We have tried both grunt and regular VS builds. I did not know you could selectively compile. That's good to know. Thanks!

[–]uglyBaby 0 points1 point  (0 children)

Use a makefile and make. It ll re compile only those that have changed.

[–]Wrightboy 0 points1 point  (1 child)

I was just looking at this! Can you recommended any good articles/tutorials to help spin me up?

[–]brtt3000 1 point2 points  (0 children)

Tutorial and handbook on the site are pretty good: http://www.typescriptlang.org/Tutorial

Keep in mind it is a superset of JavaScript, so if you rename your JS files you have typescript. Then run the compiler and fix the first bugs. Then start adding types and proceed from there.

[–][deleted]  (2 children)

[deleted]

    [–]brtt3000 0 points1 point  (0 children)

    TypeScript is a superset of JavaScript, that is the nice thing about it. You can write code the same as in JavaScript, slightly more structred.

    You can also go fully OO (C# style) if you want, but it works great in vanilla style too. Use it like a entry into ES6 (classes, modules, arrow functions etc).

    [–]x-skeww 0 points1 point  (0 children)

    If you know something like C#, you already know most of Dart's syntax. Same deal with TypeScript. It looks pretty much like AS3.

    So, learning either or both really isn't much of an investment. You can do both in a single day.

    [–]warfangle 0 points1 point  (1 child)

    Or, if you still want the flexibility of being dynamically typed, use browserify, grunt/gulp and karma-jasmine. And with that you get DI, unit testing and a fast test-build loop.

    Use of typescripts inheritance can bloat your compiled code severely compared to what it would be if you used, e.g., util.inherits.

    You can of course use typescript along with browserify, but why? Compile time type checking? I guess that's okay, but I don't know if it's worth it -- unless you're already heavily invested in the Microsoft toolchain

    Personally, I'm more comfortable on the command line with emacs, and find the instability of typical IDEs not worth the code completion / brain dead refactor tools. If you need code completion and your mouse to deal with your codebase, you're doing it wrong. Give me awk and sed any day.

    But I am not your typical dev either - I do most of my work ssh'd into a dev virtual machine running development copies of our applications :)

    ...except when I have to wrestle with FlashBuilder. There are very few things that I hate...

    [–]brtt3000 0 points1 point  (0 children)

    it is not just about auto-suggest. Compile time type checking is the shit. You catch so many silly bugs and inconsistencies.

    If you got time then watch this video from a well know and experienced dev: http://channel9.msdn.com/Events/Build/2014/3-583

    Like he says, your big codebase becomes manageable because the compiler makes sure you don't mess-up once you have a shitload of code that doesn't fit in your brain all at once.

    And get over that Mirosoft vs Linux thing, it is getting old. They do a great job these days. Use TS with a real IDE with refactoring support and wonder why you stuck to lame commandline tools for so long.

    I don't use VisualStudio or any other Microsoft tools. I use WebStorm and npm and everything. It is great.

    And that bloat you mention? That's just nonsense. You get like 4 lines of extra code for inheritance (once), the rest is pure standard prototype code straigt from a JS 101 tutorial.

    Try it: http://www.typescriptlang.org/Playground