Albin Jose@suppo.fi to Programming · 1 year agoWhat will happen if we put a semi-colon after a for loop in C++?message-squaremessage-square17fedilinkarrow-up120arrow-down15
arrow-up115arrow-down1message-squareWhat will happen if we put a semi-colon after a for loop in C++?Albin Jose@suppo.fi to Programming · 1 year agomessage-square17fedilink
minus-squarepelya@lemmy.worldlinkfedilinkarrow-up8arrow-down2·1 year agoPro tip: for(;;) takes less to type thann while(true)
minus-squaredeegeese@sopuli.xyzlinkfedilinkarrow-up21·1 year agoMy programs cause enough tears on their own without having to put them in the code itself.
minus-squareSigmatics@lemmy.calinkfedilinkarrow-up1·1 year agoI still struggle to see how that’s valid syntax
minus-squareSigmatics@lemmy.calinkfedilinkarrow-up2·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-squareDreamButt@lemmy.worldlinkfedilinkEnglisharrow-up1·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