Hacker News new | ask | show | jobs
by throw-qqqqq 30 days ago
> I consider it common knowledge TBH

For a seasoned C developer, I’d agree with you, but parent declares himself

> As someone who only writes C or C++ occasionally

… so I think it’s fair enough to not know such details.

C semantics has a few details that often surprise non-regulars, despite being such a small and simple language.

1 comments

I appreciate Zig's approach, where the runtime complains when over/underflow occurs with the regular `+` operator but explicitly wraps with `+%` (or even saturates with `+|`). Takes a little getting used to (that and explicit unsigned/signed casts) but it's much clearer.
Sounds quite interesting! I do prefer to be explicit in low level programming.