Hacker Newsnew | past | comments | ask | show | jobs | submit | vivainio's commentslogin

Some people were doing that before TS got async/await compilation directly to ES5 (in TS 2.1). Right now, having Babel in the TS pipeline is not that useful anymore.


I've had some major headaches getting TypeScript to work with Babel and Webpack 2. The main reason I had to use Babel was because I wanted to use Webpack 2's tree shaking feature. Do you know if it's possible to use just TypeScript and Webpack without Babel, and still take advantage of tree shaking?

Honestly this is the main thing keeping me from using TypeScript. I've spent hours, maybe days trying to deal with the mess of Babel/webpack/TS combined with ES6 modules (necessary for tree shaking).

Another problem I ran into was using various packages that weren't typed, but I suppose I can solve that by 'allowing' implicitAny.

I'd really love some advice on this because I want to use TypeScript. It's just been a major headache so far because things are complicated enough with all the other moving parts (Babel presets, import vs require, better but still not well documented Webpack 2, etc.).


«Another problem I ran into was using various packages that weren't typed, but I suppose I can solve that by 'allowing' implicitAny.»

You can keep noImplicitAny and any-type just specific packages that can't/won't be typed. The declaration is now as simple as:

    declare module 'path/to/module-name'
Typescript will any type modules that you declare that way. You can also use star (*) and star-star wildcards in the module name.


Oh, that's great! Is that a recent change? I remember circumvrenting my issues with 'declare module' but it was more involved than just one line.


Yes, simpler module declaration is relatively recent to Typescript having arrived in Typescript 2.0 (released in September).


It's very useful if you want to use native APIs that arrived with es6: Promise, Map etc. TypeScript doesn't shim those


Huh, the benefits are immediately tangible, the biggest one being less code to do the same thing while remaining typesafe.

In the meantime, you probably need slightly, but not massively, better developers.


The problem is that F# leads to shorter code by being incrementally better all over the place - so every example you show to someone he'll go "oh that's cute but I can do something similar with C#" but when you sum up those "cute tricks" you end up with 1/3 code, much less noise, and easier to maintain code. But it's hard to sell because there's no "one big thing that is 3x better than C#".


I don't think you need better developers. I've had one college intern so far that I've had work with some F# and she liked it better than C#.

Lots of stuff that is easier to do. Not much that is harder.


When you don't know a lot learning something different is actually easier than when you're already proficient in C#. You expect an intern to take x ammount of time before he can be productive, so if he spends it on learning how to do it with F# or C# it won't change the x much. But when you have a senior who knows how to do something with C# he will not want to invest ammount similar to x, even a 1/2 of the time, because he can get it done with what he knows.

Like I said to OP F# doesn't have that "hard sell", it's just a bunch of incremental improvements that end up being a big deal together, but each one on it's own is unimpressive.


You rarely have Tabula Rasa developers - average developer is probably proficient in Java and/or C#.

I would say HM type inference is a non-incremental "hard sell" improvement, but it depends on the target audience :).


As a developer with 10 years of C# experience and two weeks (and counting) of F# experience, I'm already finding it easier and more enjoyable to do a lot of things in F#. Results may vary.


Miguel seems to want break and continue in F#. That's my pet peeve as well; Scala doesn't support them either, but surely F# could do a better job here. The rest of the improve story is very solid, so it's shame to leave this fruit hanging.


For something fun yet with that elusive 'real programming' edge, play around with Rust.


I love that your response to someone saying they lost their confidence in the pursuit of new technology for its own sake is to recommend a new technology to learn.


Rust can be used for web programming, when it's a very "real programmers" language, so they response is perfectly valid.


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

Search: