Skip to content

Instantly share code, notes, and snippets.

@snackycracky
Created November 20, 2017 19:42
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 snackycracky/2750e456f04def91de1243fc857557bb to your computer and use it in GitHub Desktop.
Save snackycracky/2750e456f04def91de1243fc857557bb to your computer and use it in GitHub Desktop.
here is my mustard to the types topic:
- it’s more effort to serve to types.
- the effort is only worth in some cases, so it would be nice to opt-in (e.g. business logic) or opt-out (boilerplate, gluecode) to types anytime.
- with types the developers get some of the errors in their face and not the customer
- dependent types are the future in my world (https://en.wikipedia.org/wiki/Dependent_type)
- if we (js-devs) would just have something like the stanley millner typesystem then we would have a compromise between effort and runtime safety: https://drboolean.gitbooks.io/mostly-adequate-guide/content/ch7.html
- static analysis through types would give me a more powerful Webstorm than ever
- some problems (e.g. promise is not returned, promise chain broken) can also be detected by eslint (https://github.com/xjamundx/eslint-plugin-promise)
- union types, the absence of `null`/`nil`/`undefined`, the Maybe Type are things that a developer in 2017 should know and value. (https://robots.thoughtbot.com/modeling-with-union-types, http://rundis.github.io/blog/2016/elm_maybe.html, https://guide.elm-lang.org/error_handling/maybe.html)
- a whole scientific branch has done a freaking huge amount of research about types (https://en.wikipedia.org/wiki/Algebraic_data_type, https://en.wikipedia.org/wiki/Category_theory) compositions with monads are just the tip of the iceberg (https://www.youtube.com/watch?v=gHiyzctYqZ0&t=33s, https://bartoszmilewski.com/2014/11/04/category-the-essence-of-composition/)
- typing is a way of thinking about programming something. It’s `design thinking` first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment