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

More language isnt necceseraly better. The more features a language has the harder it becomes to read. When a language gives you a lot of options, you do spend more time chosing btween options that on the problem at hand.


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.


I think I can see why, I never tried C or C++, but Zig was a pleasure to learn and play around with.




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

Search: