Skip to content

Instantly share code, notes, and snippets.

@deepak
Created January 30, 2024 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepak/0297a9a92052ecad0efc827c1160b042 to your computer and use it in GitHub Desktop.
Save deepak/0297a9a92052ecad0efc827c1160b042 to your computer and use it in GitHub Desktop.
How/Why did TypeScript beat Flow

How/Why did TypeScript beat Flow?

https://twitter.com/ryanflorence/status/1751996988525064343

How/Why did TypeScript beat Flow?

I never tried flow and was kinda bullied into TS late, so I wasn’t around to experience how it happened.

9:23 PM · Jan 29, 2024

Microsoft owned DX

Microsoft - along with Typescript, VSCode and GitHub owns DX (developer experience) at this point.

They own DX by:

  • $MSTF getting an image makeover. They were no longer considered evil. The importance of this cannot be stressed. Devs would never buy into the old Embrace, extend, and extinguish evil Microsoft :-)
  • open sourcing VSCode
  • creating LSP ie. Language Server Protocol
  • VSCode and LSP getting popular
  • buying GitHub
  • killing GitHub atom
  • they put in a lot of effort doing all this

I am waiting for MSTF to, start charging developers for using GitHub and VSCode ala Unity and Apple.

community contributed types aka Definitely Typed

Community contribution for projects not having types aka Definitely Typed - was huge. The flowlang equivalent, flow-typed seems like a baby. The repo for Definitely Typed seemed so huge that, I was scared, my browser would crash with an OOM (out of memory error), before parsing all that HTML.

Typescript seemed more inclusive

Still not sure how Definitely Typed got so many contributions. I think it's because, it had definitions even for the non-React libraries like jQuery

Flowlang seemed more react specific and insular.

Typescript seemed more inclusive and popular outside of React.

And the success of React was not guaranteed. It seemed foolish to bet on Flowlang, which was advertised (to my brain) to work specially well with React. What if Angular or Vue or the gazillion other frameworks became the popular ?

Typescript seems more inclusive and non-React specific.

Typescript was being used even in non-web and React projects like Devops and server-side code. Flowlang seemed more React and browser-side

Flowlang was marketed as being built for React

One of the selling points for Flowlang was that:

  • this is how the React team builds React itself - and their React apps
  • the DX and dev flow is customised for React. Typecheck your React apps without any friction.

But React itself is a big old bag of friction. React seemed like a - build your own adventure game:

  1. react itself is new
  2. use ES6. which was new for me along with React
  3. configure Babel. also new
  4. configure webpack. also new. had used requirejs and jQuery before that. which was much easier.
  5. JSX and editor support
  6. learn react router
  7. learn Flux, then Redux and then so many others

This build your own adventure game seemed like a death by a thousand cuts.

Saying Flowlang will save you time seems laughable. The marginal cost of adding yet another build step, for Typescript vs Flowlang seems minimal at this point.

Angular adopting TypeScipt

Flowlang never seemed to have much adoption outside of Facebook and React. Big projects and companies like Google and Angular using TypeScipt was very impactful.

Weirdly enough, even Google's Traceur losing to BabelJS seems groundbreaking (for me at least) Which to me showed that Flowlang is not guaranteed success, even though Flowlang was backed by a big FANG company like Google.

Typescript getting adopted by Angular was huge. VERY surprising considering that Google had traceur, angular compiler, closure and GWT tools.

Cult of Anders Hejlsberg

Anders Hejlsberg, the inventor of TypeScipt being a rockstar certainly helped

Dart being a option also boosted Typescript - weirdly enough. It was a validation for types and more importantly the messaging for both was the same.

Both projects promised to:

  • add types
  • admitted that Javascript sucked
  • fix JS.

But Typescript was promoted as - just being JavaScript, in the same way React is just JavaScript 😅. All JS code was valid TS. Flowlang did not have that messaging - at least for me.

I do not remember Flowlang, bashing on JS. Might be wrong though.

Stackoverflow surveys and all that marketing

Stackoverflow surveys personally swayed me. All the reports, how TypeScript was winning. Flowlang seems to always play second fiddle to Typescript.

I am vulnerable to marketing - I admit it 😭

Facebook jest moving away from Flowlang

News such as Jest moving away from Typescript. Enough said.

React innovated too much

React and their ecosystem innovated too much - all at once - Flow, webpack, ES6, babel, react router, some other router, flux, redux, some other state manager, jest, graphql, ReasonML/OCaml and even new visual IDEs based on GitHub atom.

Personally I was introduced to a LOT of new technology along with React. The React ecosystem never felt stable unlike Angular or Vue.

Flow felt like a cut too many. A new typesystem and a new language and new tooling is a massive ask on top of everything else. It might have been different if Flowlang was introduced in isolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment