(yuvalt @ sep. 06 2004,17:05 Wrote:i don't think we'll ever reach an agreement on this thing.
i agree! there will ever be an agreement about coding standard and formatting.
but... by using a code beautifier, we could increase the quality on this code and make it more readable for every body.
i have been using gc (great code
) for a while and it works fine for me. the only switch you desperately need is
"-no-code_decl_move_top-" since the default is to move declarations to the top of the scope and the could ruin the code since also class objects with constructors will be move.
the rest is just cosmetics. my opinion is that gc beautifies to much (read: changes to much), but using a beautifier gives you and your co-programmers so much back that i'm wiling to accept that
if gc is to be used, the gc.cfg file (at least containing "-no-code_decl_move_top-") could be added to cvs root directory.
most of the part of this topics discussion could then be about the gc.cfg file
some words about code beautifier
q. how to introduce them in a project?
a. check out all code and parse the beautifier through the files, then check in the code without doing any other changes :thumbsup:
q. doesn't a good programmer write code that is more readable than what a beautifier could do?
a. yes, but how many of us does really take us the time of doing that :shifty:
q. could i thrust a beautifier?
a. yes, but first read this how can i trust beautifier programs??!!
also read this from: how to write unmaintainable code
never beautify: never use an automated source code tidier (beautifier) to keep your code aligned. lobby to have them banned them from your company on the grounds they create false deltas in pvcs (version control tracking) or that every programmer should have his own indenting style held forever sacrosanct for any module he wrote. insist that other programmers observe those idiosyncratic conventions in "his " modules. banning beautifiers is quite easy, even though they save the millions of keystrokes doing manual alignment and days wasted misinterpreting poorly aligned code. just insist that everyone use the same tidied format, not just for storing in the common repository, but also while they are editing. this starts an rwar and the boss, to keep the peace, will ban automated tidying. without automated tidying, you are now free to accidentally misalign the code to give the optical illusion that bodies of loops and ifs are longer or shorter than they really are, or that else clauses match a different if than they really do. e.g.