Hacker News new | past | comments | ask | show | jobs | submit login

I've been trying to convince my workmates to try something other than pure JS (with Angular), but am not having much luck. TypeScript seems to have the most buy-in, but most of the guys in the office aren't convinced of the benefits of a proper type system, the just see it as more work for them for little upside. Any ideas?



What kind of office are you in? If it's filled with a lot of front-end JavaScript "ninjas" I doubt you're going to make much headway. I hate to be pejorative, but I do mean the ninja part pejoratively.

My best advice would be to try to start by convincing the guys with the most dev experience in other languages/serious dev experience/(dare I be controversial and say )guys with the most formal CS education first.


Mostly back end guys who have to do front end, and the genuine front end guys are indeed "ninjas" (though, I must say they are very good at wrangling JS and debugging the problems we inevitably run into). My boss is convinced at least, and I recently just convinced the team to move to proper testing + CI system (which the boss had wanted to do for 12 months but never had enough buy In from the team, so he was pretty stoked when I brought it up), so perhaps it'll just be a waiting game.

I'm tempted to reimplement a part of the system I'm currently working on in TypeScript to demonstrate it. I do worry that I'll come across as trying to show the team up though, as I'm still pretty new here :(


You're not going to get anywhere with the ninjas. Suggest a system that's similar to what you do your backend in. Is your backend in Java? Suggest Dart. Is your backend in C#? Suggest TypeScript. Is your backend in Ruby? Maybe you can at least get some CoffeeScript going.


It is hard, if you look at the article, it even says "but we are stuck with it". With Angular JS there is just not that much JS to make it a big issue. So I am not sure if that is the best framework to switch to a new language (they'd have to re-map all the tutorial and documentation and everything they learned to this new language).

Coffeescript was a very popular on HN some year or two back. Then there was kind of a backlash against it and I haven't heard much since.

Now I am looking at Dart, I think that one of the few viable alternatives coming up. They are moving to make it a standard. There is already a performant VM for it (Dartium) that can run in Chrome. It compile to JS and what what you want but it has Google behind it. So it has some chance. Dart+Angular integration is going very well. They even added IDE completion for it. So if I gave you any advice I would say look that.


Typescript is hard.

It's module system is a mistake(it should be module system agnostic,not AMD or CommonJS),and very confusing.

The biggest problem is javascript is so dynamic you cant create type definitions for every library outthere and expect the typesystem to work.

Typescript is good if you are porting something from AS3/C#/Java to javascript,or if You want to model a complex domain,without touching the DOM api(or node api).

It sucks as soon as you try to use jQuery with it.You end up with any everywhere which defeats the purpose of that language.

In my opinion,if you need to pick a js alternative,choose Traceur.


I could not agree less with your post. I ported a 12k loc JS project to TS and it usese JQuery heaviliy. The result was that the static type system could point out 6 bugs from my original code that unit tests did not find and now I have statement completion and powerful refactoring tools for everything as well. It plays really nice with JQuery if you have the right type declarations and I am more productive now with all the code intellisense I get from the IDE.

Also the module system is module system agnostic and it can compile either to commonjs or amd, it depends on a compiler switch. I am using mostly requirejs and it works well.


Umm, no experience with typescript here, but can't you use the type annotations from the DefinitelyTyped project [1] to avoid everything becoming `any`? There are open source type annotations for all major (and many minor) libraries, including jquery [2].

[1] https://github.com/borisyankov/DefinitelyTyped

[2] https://github.com/borisyankov/DefinitelyTyped/tree/master/j...


definetly typed doesnt fix everything,just have a look at the ambient declarations.


Is it that they don't properly understand the benefits of switching on their productivity, or that they just don't think the productivity gain will be large enough to justify the switch?

If it's the former, then yeah, a logical explanation might help, but the latter seems a bit more subjective, and it's possible they just see their current workflow as completely adequate. Quantifying productivity gains is tricky, and the "if it ain't broke, don't fix it" philosophy has some merit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: