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

I do this

Name: Anonymous 2016-11-17 14:54

return(EXIT_SUCCESS)

And I don't care if you don't like it. It doesn't violate the standard. All you return EXIT_SUCCESS jerks can suck it.

Name: Anonymous 2016-11-18 7:40

>>10
I disagree they're zero-cost. complex preprocessor directives are not idiomatic C and you need to change your mindset and learn about wierd quirks that aren't present in plain C. IIRC the guy who wrote PuTTY also made a header that implemented control structures like foreach() with macros and if you looked at their definitions, it's pretty hard to guess what they do - you must really sit down and think about it because it looks different from how you do things in plain C and some of the stuff he puts there would be redundant and/or roundabout if it was not designed for automated expansion. then you have stuff like debugging macros which is just a pain in the ass.

basically, those abstractions are zero-cost if the only 'cost' you can think of is an execution time overhead. the actual cost is the difficulty of writing, maintaining and debugging, as well as the difficulty of understanding the code if you're not the one who wrote those macros. there's also a bit of a technical tradeoff is that complex macros mean bigger programs and longer compile times but this is likely not too noticeable in practice.

this doesn't mean that this sort of metaprogramming is pointless (although dynamic and/or functional languages are IMHO better for metaprogramming than C + text replacement: it's just more intuitive when you have things like lambda or eval). but there's always a cost.

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