Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> In my opinion types are a poor man's schema

What's the distinction you're drawing here?

> my email is not a string, it's a email, and my longitude/latitude pair are not just ints they have specific ranges, saying that longitude is 500 is as wrong as saying it's "foo"

I fully agree. Those sound like exactly the kind of thing I would enforce using types.

> and this only in the places I need, no need to a schematize or assert every simple function with obvious parameters.

How do you enforce that all code paths go via your schema? Just visual inspection?



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: