Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Well afaik Bool is just a typedef to an int anyway. But why int64? Why not just int?
-
monkcs5593y@Lensflare yeah, but _Bool is an int type big enough to hold 0 and 1. And by letting the compiler know it explicitly is a _Bool it can help the optimization
-
Are you seriously expecting C programmers to move on from the 80s/90s...
(lol jk, before I get massacred by the "low level" gang) -
That can make sense in order to harmonise the APIs so that they have always the same return type. What's actually fucked up here is "i64" instead of int64_t. I take that "if (0)" BS as placeholder for later implementation of actual logic.
Also, I never use _Bool because using something else leaves the option of using 0 for "ok" and introducing more detailed error codes later. Like, getting the boolean info, but if a closer look is required, also a reason for "why not".
@RememberMe Of course not because that was before millennials entered the game and things still made sense. :P -
Because when I'm programming in C it's often for hobby projects where I may actually encounter an ancient compiler.
I got this function skeleton to implement, who the fuck return a Boolean value using a int64?!?
Why are C programmers so damn insistent of never using the _Bool type that is in the damn language since C99? Have they been living under a rock since 1999?
// An irritated C++ programmer
rant
c stdbool.h