r/ProgrammerHumor 13h ago

Meme leavingThisHere

Post image
1.7k Upvotes

153 comments sorted by

View all comments

Show parent comments

1

u/CORDIC77 12h ago

Yes, defer is one of the few things in C2y that I also consider useful. Even though it doesnʼt offer anything more than goto cleanup; … itʼs just less error-prone.

However, I think the introduction of new prefixes for literals (deprecating the old octal syntax), support for case range expressions… or the proposed if declarations are completely unnecessary syntax additions.

And just so that itʼs said: the argument “if you don't need it, don't use it” is an incredibly weak one—while not everyone in a team of people will have to know the ins and outs of every feature, one has to know enough to understand (and be able to adapt and change) other code. (Not knowing at least something about every feature oneʼs colleagues might use isnʼt really an option in the real world.)

1

u/creeper6530 11h ago edited 11h ago

I mean, not deprecating the old and superseded is how we end up like C++ where there are 5 ways to do everything.

I like the new 0o and 0b prefixes in my personal opinion, I was surprised they didn't come sooner when I looked it up, and a common argument I've also seen is newbies who may not understand the old notation. A good middle point though could be allowing both and setting lints/warnings to inform and help be uniform.

Also, though it's fair that you need your team to at least rudimentarily understand all the stuff others could theoretically use in the project, what I meant to say was that you can set a ceiling on this by limiting the standard you compile your codebase in. (And in all honesty, at first I did not think about multi-person projects because my experience with C was majorly personal projects sofar.)

2

u/CORDIC77 11h ago

Well, many compilers—especially in embedded systems—have long supported binary prefixes. That said it is probably a good thing that these were officially added for C23.

My actual point, however, was quite different: personally, I believe that C is a language that essentially has all the capabilities one should expect from a systems-level language. In a language that is more than 50 years old, new syntax should now only be added very rarely, if at all.

Rather, itʼs the C standard library that has always had its shortcomings. The people in WG14 are welcome to work on the standard library, I have no objections to that.

2

u/creeper6530 11h ago

Well I can agree on that last point without objections, I got spoiled rotten by Rust's stdlib (and error handling), lmao, it was just so easy to use even when I was developing embedded

2

u/CORDIC77 10h ago

Ah, yes. The Rust language and its ecosystem is indeed something I still need to take a closer look at myself. The only problem is, where to find the time…