Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Preprocessors and Macros

Name: Anonymous 2014-01-25 0:17

I have never encountered anything more pointless and stupid in my years of programming, EVER.

It's pretty much the only thing that holds me back from giving contributions to most open source C programs. Every source file is littered with #ifndefs every-fucking-where. 90% of the code is preprocessor directives and the rest is real C code. It's so fucking pointless and it's not even metaprogramming. I mean #define for using constants? Really? Can't you just use const for that? Sure, it's useful for separating your header files and relating functions in their source files but that's it. Dennis Ritchie should have just built that in the language. Sure, it's also useful compiling different lines of code for different kernel versions or different CFLAGS but whatever, it just proves how broken a programming language is.

What do you think /prog/? I've only parroting C shit, how does your favorite use macros?

Name: Anonymous 2014-01-25 1:05

As someone who uses C often, I can't contribute anything to open source projects for the same reason. How's that stopping you from working on your own projects, though? I thought CPP abuse was widely known as a nigger thing to do.

Macros are useful for making horrible looking functions/repetitive tasks less ugly, but that usually indicates a bigger underlying problem in your code and it's better to deal with that first.
I guess they're fine for inlining functions too, but isn't inline part of DA STANDARD?

I rarely use include guards because my shitty toy programs work without them (there's rarely any header that repeats anyway). In most cases you can be careful not to the include the same header twice and you're done. Not sure how it is for bigger projects, though.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List