Albin Jose to Programming • 1 year agoWhat will happen if we put a semi-colon after a for loop in C++?message-square17fedilinkarrow-up120arrow-down15
arrow-up115arrow-down1message-squareWhat will happen if we put a semi-colon after a for loop in C++?Albin Jose to Programming • 1 year agomessage-square17fedilink
minus-square@[email protected]linkfedilink21•1 year agoMy programs cause enough tears on their own without having to put them in the code itself.
minus-square@[email protected]linkfedilink1•1 year agoI still struggle to see how that’s valid syntax
minus-square@[email protected]linkfedilink2•1 year agoYes, I know. On the other hand, when you see people code-golfing C, this is on the light end of the spectrum
minus-squareDreamButtlinkfedilinkEnglish1•1 year agoAs yes. Readability destroying anti-patterns. My old enemy
Pro tip:
for(;;)
takes less to type thannwhile(true)
My programs cause enough tears on their own without having to put them in the code itself.
#define EVER (;;)
I still struggle to see how that’s valid syntax
But it compiles.
Yes, I know. On the other hand, when you see people code-golfing C, this is on the light end of the spectrum
As yes. Readability destroying anti-patterns. My old enemy