Obsessive Compulsive/Refactoring Disorder

Started by
26 comments, last by Ravyne 13 years, 1 month ago
For a time, when working on a project, I would feel slightly displeased with how some code look, that I would start completely from scratch. This compulsion was so disruptive on my projects... it's tough, but I'm trying very hard to keep what I have, and make minimal, surgical changes, as needed, without throwing the baby out with the bath water.

Regarding code refactoring, it is important to have clean, organized code, but it's also important to get your deliverables out there! Users care about the final product, not the code =)
Advertisement

As a tip I recommend coding with whitespace hidden characters on. It helps to relieve the anxiety of not knowing. :unsure:


I feel your pain brother!
Whitespaces at line ends are usually byproducts of automatic formatting or, more commonly, copy-pasting into an already formatted line. Repeated copy-pasting compounds the effect and eventually (eg after you've reformatted your loop like 10 times) you'll end up with more spaces trailing after the closing brace than there are actual characters in the statement. Nasty (well, not really - just annoying) stuff that I think The IDE should take care of automatically.

I've seen lots of professional products and it seams that these guys don't suffer like I do.

That's just because they can lose their jobs if they miss their deadlines. If they had money and time they'd probably be at least nearly as bad.
Mindwipe - I know I probably shouldn't write this. And I know this will look all too ironic as soon as I click Submit and it loads up in my shiny Firefox web browser, which I've grown to hate so fondly; and I know - I know - you would never consider anything like this - not seriously at least -, because you're a socially responsible male human.

Nevertheless, having re-read your post and analyzed its apparent cry for reason in a universe that is bordering so close to madness, I have to ask - if only to suggest an alternative solution: have you tried using alcohol to keep your OCD in check and to write more creative code? I know it's not much, but for inspiration, look at Charlie Sheen. Just look at him. Not a worry in the world. Zero refactoring problems. I mean, you can't just come up with that stuff. You need a muse. Let the good old A-hol be your muse.
Yeah I think I screwed up when I wrote the topic. By refactoring I met changing code to make it look more pleasing to the eye; not just functionality. I don't know why, but for some reason ugly code reminds me of ex-lax. It irritates the *** out of me. Then OCD kicks to change, reword or event rewrite things to make them look neater then a skeeter's peter....lol This is what I'm talking about(the code, not skeeter). I get too obsessive/compulsive about cleanliness and order. Not just in architecture as I said before, but in code formatting, spacing, caps on *certian* comments, where the code hands over 80(column) characters or not, adding spaces at the ends of lines(hehe j/k). Stuff like inserting tabs so that all the variables align to the 29th column, But then that doesn't do because 29 is an odd number so I add a space to make it 30....gawd that sounds so bad when I write it out... but that is what I do sometimes.

I have gotten better because I forced my self to slap some things together and ignore what it looked like, only looking at it functionality wise. Its seams when I just slap stuff together for tests and/or other stuff I get the most successful code. Successful as it only took like 10-15 minutes and its working. So any ways... sorry for the bad news guys
Its called designing on paper. You can spend a day designing and a week of coding, or no design and a month of coding blindly on the fly.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Ive been programming 6 hours every single day since I was 12 and got my first 286 laptop with monochrome monitor :)
I probably spend 5.5 of those hours optimizing code.
I never read tutorials, manuals, references, but I find myself asking a few awesome programmers I know on IRC alot about stuff now and then.
Its probably the worst way to code there is, and my projects average on 3-5 years from start to finish. But I like it! I must code!!

Happy coding!
I think if you ever want to get anything done just stick with a certain convention and follow it through no matter what.

Sticking with a convention (or even an initial concept) for the entirety of a project makes you a better programmer than any new architectural design ever could, as it generally means you get the project finished.

I was recently working on a project with a guy that was a bit too much of a perfectionist when it came to coding and it made me realize just how stupid it is to be perfect when it comes to code. The language you write in is not perfect, The programming language you write in is not perfect, the whole idea of programming as a means of developing a program is not perfect so why should your code be?
The language you write in is not perfect, The programming language you write in is not perfect, the whole idea of programming as a means of developing a program is not perfect so why should your code be? [/quote]
That doesn't mean you have to aim low. ;)
Latest project: Sideways Racing on the iPad

This topic is closed to new replies.

Advertisement