Hacker News new | ask | show | jobs
by joshspankit 813 days ago
“I don’t want to infer types from my code. I’d rather infer the code from the types.”

Ditto.

The world where data and it’s type is the SSOT means you can trivially validate every bit of code that touches it.

1 comments

> I don’t want to infer types from my code. I’d rather infer the code from the types.

I use type inference for this: the compiler looks at the existing types and then infers the type of the code I haven't yet written and tells me. I then write code based on the type given to me by the compiler.