
Lesser-known C coding styles - Kristine1975
https://twitter.com/aisamanra/status/779057953542242304
======
adrianratnapala
I shan't be taking it up, but this semicolon-first style has merits.

The example looks perfectly readable to me. And it is probably makes it harder
to miss semicolons, because all those for one block line up in a single
column. The main thing I fear is it increases the chance of an accidental:

    
    
        if(foo)
        ;  do_something_i_though_was_conditional()
    

But if you are already using braces everywhere, {then this isn't a problem}.

~~~
turbohz
Elm uses a similar style, with semicolons and commas at The beginning.

The problem I have with it is that prevents easy reordering of lines, in lists
or records, because they first one always starts with a curly brace.

------
informatimago
I'm partial to the lisp style:

#include <stdio.h>

int loop(int i){ return ((i==0) ?0 :(printf("%d\n",i),loop(i-1)));}

int main (void){ return loop(10);}

~~~
Kristine1975
Nice. At least if your compiler implements tail call optimization, otherwise
sooner or later you'll get a stack overflow.

