curimit / SugarCpp

SugarCpp is a language which can compile to C++11.
135 stars 13 forks source link

Voluntary block braces #40

Open ozra opened 9 years ago

ozra commented 9 years ago

Blocks are defined by indentation as should be. If, for any reason a certain block would have to become rather long in a certain piece of code, it could be nice to clarify structure with braces. They may also be an aid in correctness: if they are used, they must match up correctly, indentation wise, this may help tie in indentation errors when they occur (copy n paste in shaky editors or whatever - shit happens).

Some team might even decide that they do want to use braces throughout for clarity - well, why stop it? I prefer brace less 99% of the time, but that's me.

When it comes to voluntary semi-colons - I'd say no: That symbol could be put to other uses instead. Using it as statement separator (as in Rust) isn't needed either imo - how often do you just have to line up a bunch of statements on one row to preserve readability? Never.