Felix Palmen 📯 · @zirias
36 followers · 153 posts · Server techhub.social

@jhx You asked for it, so I'll answer it:

Imho, C++ design is broken from the very beginning. It wanted to provide language constructs, still maintaining full compatibility (which already failed many years ago, cause the languages took different roads).

It combines (IMHO generally a bad idea) with explicit resource management (an *awful* idea, forcing you to use which will in turn mandate creation of purely "technical" classes, just to manage resources).

It wanted , but that's impossible without breaking C compatibility, so it came up with , actually a on steroids.

Overloading also doesn't fit into the simple C library ABI (where symbols are named just like the function), so it came up with "name mangling" ... which is especially horrific because it is *not* standardized.

Ah well, I could go on 😂

#oop #c #exceptions #raii #generics #Templates #preprocessor #linker

Last updated 1 year ago

Wolfram wants peace · @wolframkriesing
266 followers · 268 posts · Server mastodontech.de

Another shortcoming.

"The directive in C and C99 is a preprocessor directive, which means it's handled before the actual compilation process. It does not respect scope ..."

So every ` ...` you put somewhere must be named to be globally "valid", if you want to give it good names. There are just no local defines.

#preprocessor #define

Last updated 1 year ago

GeekProjects News · @news
2 followers · 2453 posts · Server geekprojects.com
Oblomov · @oblomov
244 followers · 3804 posts · Server sociale.network

OK people, I need a “proper” bibliographic (book or journal article, if possible) for the C trick known as X-includes (including the same file multiple times with different defined macros as a sort of pseudo-template engine). Suggestions welcome.

#xp #preprocessor #reference

Last updated 2 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

I've written 2.6k lines of , but due to using a to parts multiple times in a differently 'd environment as an emulation of , so the real code length is much longer and the takes over 15 minutes to compile it.

Last time it compiled it gave me a blank screen, trying to debug it is painful with this turnaround.

#compiler #mesa #templates #define #include #preprocessor #code #glsl

Last updated 5 years ago