Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Bracket/Indentation-style converter

Name: Anonymous 2010-10-10 13:43

Greetings /prog/

As you are aware there is a plethora of brackets/indentation styles in the dicipline of programming.

http://en.wikipedia.org/wiki/Indentation_style

My opinion is that the Allman style is better than any other. Other styles are inferior to Allman style in regards of readability and I would prefer to work with code in Allman style only.

Thus, I find the need for a utility to convert the text in a set of files into the Allman style necessary.

Would any of you know if such a utility exists? Is there even an extention to emacs that could do this?

Name: Anonymous 2010-10-10 16:47

I never paid any attention to it, but I seem to use a variation of Allman style.  I don't space between method names and their argument parentheses, occasionally I mash comma-parameters together and arithmetic operators closer, the latter usually in the case of index calculation.  I also sometimes one-line certain statements.

int vagueExample(int x, int y)
{
   if(y < 0) return something(x,y); // 'for' and 'while' loops too
   else y = somethingElse(x);
   return something(x,y);
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List