How zealous are you about code cleanliness?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

How zealous are you about code cleanliness?

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Typically, mine will be similar, however protected will more likely be placed higher up than privates.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post 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
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
User avatar
jyhm
Forum Contributor
Posts: 228
Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:

Post by jyhm »

I generally like to protect my privates so my privates don't become public.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post 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
Post Reply