3 ms·
I guess you can (at least in C ) use && where you would use “if” and a convoluted while where you could write a “for”.
by pfortuny 2y ago
I guess you can (at least in C ) use && where you would use “if” and a convoluted while where you could write a “for”.
- akira2501 2y ago#include <stdio.h> int main() { int a = 1; switch(a) case 1: puts("there's always this"); } Switch accepts a statement. It does not have to be compound.
- tgv 2y agoWhen you're dedicated and don't have to work in a large team: ihatetheletterf.h: #define cond if #define loop for #define otherwise default #define untrue false #define real float And when you work in a (large) team, they won't likely accept weird constructions just to avoid a letter anyway.
- reshlo 2y agoYou just used the letter f 13 times to make that file, though.
- thaumasiotes 2y ago> and a convoluted while where you could write a “for” What's convoluted about it? A `for` is about as simple as syntactic sugar gets. for( a; b; c ) { } is exactly equivalent to a; while( b ) { c; } (OK, a variable declared in `a` will remain in scope after the while loop terminates, but the only way for this to have an effect on anything is if you intentionally refer to it afterwards, in which case you needed to predeclare it for the for loop too.)