3 ms·
I like it a lot. Especially the part about ditching const qualifiers. They clutter function declarations, don't make the intent any clear, and almost never impr
by bjourne 3y ago
I like it a lot. Especially the part about ditching const
qualifiers. They clutter function declarations, don't make the intent
any clear, and almost never improve performance. Restrict, on the
other hand, I've found makes the compilers emit better code in many
cases.
But I don't like using 1 and 0 instead of booleans. Many standard C
functions (fclose for example), return 0 on success. Better to be
explicit here.
- pylua 3y agoI like using the const keyword, and believe it serves a real purpose with readability. I feel like most things are read access by default which is why it seems cluttered. I believe rust gets immutable by default correct .
- dundarious 3y agoI use an exitint typedef to signify "0 is success, non-0 is failure" and boolint equivalent to his b32. Not typesafe of course, so it's just info for fallible humans.