Hacker News new | past | comments | ask | show | jobs | submit login

One think I realized is that properly using the type system is a skill you have to/should learn.

It includes:

- Having some understanding of how type systems tend to work and common patterns around them, preferable in a abstrac non language specific way. Do not confuse it with knowing formal CS since type theories, it's not the same.

- Knowing how to effectively use the type system to encode important variants.

But probably even more important:

- Not getting obsessed with trying "perfectly"/"optimally" use the type system.

- Knowing that the moment your types and their relations get too complex it might not be worth it at all, even if you encode use-full variants. Sometimes just having runtime checks is so much better from a API UX point of view. Getting complex type system based API's right is hard and from what I see in the open source community most people do not have the skill to do it right. (Through this doesn't mean not using the type system to encoded constraints, just not over using it!). A common case where this happens is when people try to use the type system to force a DSL into a language which isn't very compatible with that kind of DSL.

While I often see people learning about how they can use advanced features of a type system but they do not learn when to _not_ use it.

Disclaimer: I just realized that what I see as Simple usage of the type system the parent post might already see as advanced usage.




This is spot on.




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

Search: