Live data from Hacker News

Flow vs. Typescript

djcordhose.github.io

1–10 of 158 posts

Re: Flow vs. Typescript

#3
The biggest win that flow has - and for me puts it over typescript - is that it has comment decorator syntax.

This means I can just write JavaScript and add comments for types. No transplier step, no messing around in a different but similar language, no additional complexity, just easy.

It's inferred types are a much stronger system imo too - gets out of a developers way more.

Typescript is great, but I really do prefer Flow in every metric.

Re: Flow vs. Typescript

#4

The biggest win that flow has - and for me puts it over typescript - is that it has comment decorator syntax. This means I can just write JavaScript and add comments for types. No transplier step, no messing around in a different but similar language, no additional complexity, just easy. It's inferred types are a much stronger system imo too - gets out of a developers way more. Typescript is great, but I really do pr…

But programming with comments is bad practice.

Maybe in this case it doesn't matter very much but there are a lot of ways comments can get lost or messed up.

Re: Flow vs. Typescript

#6
post #4

The biggest win that flow has - and for me puts it over typescript - is that it has comment decorator syntax. This means I can just write JavaScript and add comments for types. No transplier step, no messing around in a different but similar language, no additional complexity, just easy. It's inferred types are a much stronger system imo too - gets out of a developers way more. Typescript is great, but I really do pr…

But programming with comments is bad practice. Maybe in this case it doesn't matter very much but there are a lot of ways comments can get lost or messed up.

That's a very common position, but my experience shows me if the comments are not in line with the code that is usually a very good hint that the code will be buggy. It probably has been changed in such a hurry that the comment was forgotten, which doesn't bode well for the code quality.

Re: Flow vs. Typescript

#7
post #6
post #4

Earlier quoted context omitted.

But programming with comments is bad practice. Maybe in this case it doesn't matter very much but there are a lot of ways comments can get lost or messed up.

That's a very common position, but my experience shows me if the comments are not in line with the code that is usually a very good hint that the code will be buggy. It probably has been changed in such a hurry that the comment was forgotten, which doesn't bode well for the code quality.

IDEs can also mess with comments because they don't parse it as code. A simple extra linebreak added and your code breaks.

Re: Flow vs. Typescript

#8

The biggest win that flow has - and for me puts it over typescript - is that it has comment decorator syntax. This means I can just write JavaScript and add comments for types. No transplier step, no messing around in a different but similar language, no additional complexity, just easy. It's inferred types are a much stronger system imo too - gets out of a developers way more. Typescript is great, but I really do pr…

Can you explain the difference between Flow's approach and plain JSDoc 3?

Re: Flow vs. Typescript

#9

The biggest win that flow has - and for me puts it over typescript - is that it has comment decorator syntax. This means I can just write JavaScript and add comments for types. No transplier step, no messing around in a different but similar language, no additional complexity, just easy. It's inferred types are a much stronger system imo too - gets out of a developers way more. Typescript is great, but I really do pr…

> This means I can just write JavaScript and add comments for types. No transplier step, no messing around in a different but similar language, no additional complexity, just easy.

Can't you do the same thing with TypeScript's typings?

Re: Flow vs. Typescript

#10
So today is typed JS day? https://i.imgur.com/XAEeEFm.png

Guess it's time for the question then... I haven't dived into this whole types thing yet so could someone provide a TLDR about either Flow or TS being opinionated and their impact on an established toolchain?

I have no intention of changing half of my tooling just to be compatible with what fb thought would be a good idea, and even less so for ms. A build step is required, I take it, but that's not a problem. Would I be able to use old libs and build tools? Are there properly working code formatters for both? What about editor support (Sublime)?

I also understood that TS is a superset of ES6, what is Flow's relationship with ES6+?

Post reply on HN