logoalt Hacker News

lambdaonetoday at 12:38 AM1 replyview on HN

What you are describing is option types, which are an entirely valid and very useful construct that helps make programs more rather than less reliable. But you need proper language type system support and compile-time enforcement to make it work, and C does neither of those.


Replies

bnolsentoday at 1:43 AM

C++ and rust make these optionals ugly. Zig does it right. Zig also forbids null pointers and requires use of optionals.