I am really trying to understand why that necessity to push explicit typing on Javascript… It’s my…
Eduardo Ottaviani

Types have some cool features:

  • Performance optimization
  • Reduce developer cognitive load
  • Enable some really great developer tooling features, such as auto-suggestion

The most often touted feature of types is highly overrated. I thing they’re crap at finding bugs compared to using a proper TDD and pull request process, but they do catch a few bugs, too, and that’s worth a mention.

That said, one of the best features of JavaScript is how easy it is to write generic functions using ducktyping instead of strict type checking… but there are some really great type systems that have formal support for ducktyping. They’re called structural types.

Instead of simply examining the name of a type, or it’s “class”, structural types look at the actual structure of the object they’re comparing: the shape of the thing, not the name. That fact gives us a strong, formal type checking feature that is basically a standard way to ducktype your objects and interfaces.

IMO, that’s a perfect fit for JS, and that’s why we’re working on rtype & rfx.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.