Hacker News new | past | comments | ask | show | jobs | submit login
“It's Your Fault” (stitcher.io)
1 point by brentroose on Feb 15, 2022 | hide | past | favorite | 1 comment



It is annoying how badly the author does not understand the context of that function.

Specifically, this function is a part of Windows API, and that needs to support multiple languages, even the ones not designed by Microsoft. This, in turn, means you get the least common denominator -- so "using a proper type system" is simply not possible.

I think James Mickens described this very well in his "Night Watch" essay:

> You might ask, “[...] Why not use a modern language with garbage collection and functional programming and free massages after lunch?” Here’s the answer: Pointers are real. They’re what the hardware understands. Somebody has to deal with them. You can’t just place a LISP book on top of an x86 chip and hope that the hardware learns about lambda calculus by osmosis.

In other words, there are already languages with proper type systems, sealed classes, and nice resource management -- but they need a low-level interface and that's what Brent glanced at.




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

Search: