Comment on proportional reaction
groctel@lemmy.world 2 days ago
At my previous workplace we had a C macro that was something like
#define CheckWhatever(x__, true__, false__) \ whatever(x) ? (true__) : (false__)
I don’t remember this shit, so I’m just paraphrasing cursed C. The question one would ask is… why? Well, because you also want to do
#define CheckWhatever2(x__, true__, false__) \ CheckWhatever((x__ ##1), (true__), (false__)) \ CheckWhatever((x__ ##2), (true__), (false__))
And, of course
#define CheckWhatever3(x__, true__, false__) \ CheckWhatever2((x__ ##1), (true__), (false__)) \ CheckWhatever2((x__ ##2), (true__), (false__))
guber@lemmy.blahaj.zone 2 days ago
yeah… yikes. c is a beautiful language but thing like these are why macros may be it’s largest blemish. hope that codebase doesn’t keep planes flying!
thebestaquaman@lemmy.world 2 days ago
For it’s faults, I think what makes C beautiful is that it gives you complete freedom do be an absolute idiot.
Whenever I decide to hack something together with an arcane macro, I feel like an animal being released back into the wild, with the compiler yelling “Be free! Explore the mysteries of our incomprehensible world!”
groctel@lemmy.world 1 day ago
I have bad news for you
guber@lemmy.blahaj.zone 1 day ago
Image