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

Smaller language isn't necessarily better, either. Case in point: no booleans make a language "smaller"; result: each codebase will have their own, different, implementation.


There is no one way to do booleans because the choice of implementation depends on what your goals are. If you value space you should pack you booleans as bits in a larger type, but if you want fast access you should use int. bool has some nice properties becaus it doesnt have multiple states of true unlike int. C gives you types that have properties but doesnt prescribe what they should be used for.


Packed boolean arrays are an entirely different thing; as a matter of fact they are arrays, not a primitive data type.

The boolean primitive data type is a standard in modern languages. Take any language: Rust, Go, Zig... and C99 (kind of).

In C89, a project may use enums. Another macros. Another ints.


Yes and im saying they may have good reason to use different types because they have different requirements.




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

Search: