Hacker News new | ask | show | jobs
by lostdog 811 days ago
The author does have a good point about the readability of code snippets, but the right approach is to render code with type annotations when outputting these formats, similar to syntax highlighting.

I do not miss having to change in32_t to int64_t at every location in my code when I changed my mind about types.

2 comments

Jetbrains can catch those problems, but only if all of the code is in its scope of files. I’m not disagreeeing with you, I’m saying that the “toy problem” of small teams and individuals muddies the water because it seems like a solved problem but isn’t.

For enterprise scale problems it’s difficult to get the full context for a line of code. It could be in a repo you don’t even know about, run by people who you have only met once and never think about.

> I do not miss having to change in32_t to int64_t at every location in my code when I changed my mind about types.

A good reason to use logical typedefs, though.