writing.exchange is one of the many independent Mastodon servers you can use to participate in the fediverse.
A small, intentional community for poets, authors, and every kind of writer.

Administered by:

Server stats:

334
active users

#cprogramming

2 posts2 participants0 posts today

C++: Accepts huge pains to provide users access to easy to use low-level features, that are compatible essentially everywhere without implicit memory allocations and extreme control over how all resources are managed.

C-developers: “Nah, that language is not suitable for our needs, to inefficient and does nasty stuff!”

C: “Yeah, so if you have to tokenize a string, the tool I have for you is
strtok, which remembers your last function-call in a local variable that you can’t control so that we can return the next token, next time you call it. What, of course you can’t call it to tokenize something while you already use it! Threat-safety, what is that?”
C: “Yeah, so it totally makes sense to report errors by a global variable that every function shares, causes issues for multi-threading and makes sure that even the most basic functions have side-effects!”
C: “If you need to return a char and short, then of course the proper way is to instead pass two pointers to them into the function, each of which is larger than both combined, so we can write to them. Sum-types, what are those?”
C: “Namespaces? Nah, things are way more funny if all of your functions can collide with all of the functions from your libraries!”


Come on, seriously?

(I kinda learned about strtok today. I would consider myself quite firm in modern C++, but intentionally keep distance from all the inherited trash from the before-times. C is obsolete, stop using it, C++ is a strict improvement!)

#cprogramming #cplusplus