Page 1 of 1

How zealous are you about code cleanliness?

Posted: Sat Feb 03, 2007 6:49 pm
by alex.barylski
I just spent the last 4 or so hours cleaning my code of impurities :P

Not refactoring, but cleaning whitespace issues, formatting, etc...

I have a habit of arranging my functions as follows (ordering by function name length):

Code: Select all

ctor()
dtor()

public:

private:

protected:
I made sure there was proper whitespace between operators (i've been working on a beautifier - but the time being it's manual) I also align multiple lines of assignment so the '=' operators are inline with the same column... :P

I picked up that habit in like Gr. 9 Algebra and have done it ever since...

What kind of cleaning/janitorial work do you perform on your source codes?

Posted: Sat Feb 03, 2007 7:16 pm
by feyd
Typically, mine will be similar, however protected will more likely be placed higher up than privates.

Posted: Sat Feb 03, 2007 7:24 pm
by alex.barylski
feyd wrote:Typically, mine will be similar, however protected will more likely be placed higher up than privates.
Yea...I'm always twisted on which way to do those...

technically it makes sense to: public > protected > private but then there is the whitespace alignment issue which also bugs me...so I often change as I find fit :P

Posted: Sat Feb 03, 2007 7:45 pm
by superdezign
You do your formatting afterwards? Most things that I do, I developed from C++ coding, from function indentation down to my naming conventions. Cleanliness and commenting help the process tremendously.

Posted: Sat Feb 03, 2007 10:47 pm
by jyhm
I generally like to protect my privates so my privates don't become public.

Posted: Sat Feb 03, 2007 11:00 pm
by alex.barylski
superdezign wrote:You do your formatting afterwards? Most things that I do, I developed from C++ coding, from function indentation down to my naming conventions. Cleanliness and commenting help the process tremendously.
I do my cleaning up about once a week usually weekends (like today) when I'm bored and can't be bothered to actually work. Sometimes it leads to actual development and others just simple refactoring. I'm a clean freak in everything I do. My room, car, computer desktop, teeth, finger nails, sidewalk, you name it...little things really bug me...

Most people call me "anal" but I argue it's simply a difference of opinion, as I consider myself someone who pays great attention to detail :P