Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 27th, 2007, 5:53 PM   #1
MiKuS
Programmer
 
Join Date: Jun 2007
Posts: 93
Rep Power: 2 MiKuS is on a distinguished road
Messy Code - To refactor or not to refactor

I'm in a sticky situation right now,

A new project I took on recently has some really, really bad code.. which is saying something since this is only html.

There is so much mess it would take me about a week to completely refactor the webpage from the ground up.

The other option is to add to the messy code - and make it even more messier.


I know it's bad practice to add to bad code but if i have to refactor the code I'll probably loose my client..

Is it acceptable to add patches to the code to band-aid the situation and later on refactor the site when I have time?
MiKuS is offline   Reply With Quote
Old Nov 27th, 2007, 5:58 PM   #2
Harakim
Hobbyist Programmer
 
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3 Harakim is on a distinguished road
Re: Messy Code - To refactor or not to refactor

It's up to your client. You work for them, so you can explain the situation. They pay you, so if they don't want you to refactor, you shouldn't. When I disagree with my boss/client/teacher, I mention in the comments what I intended to do. That way, the next programmer doesn't think ill of me. In the end though, the client decides the best use of their money.
Harakim is offline   Reply With Quote
Old Nov 27th, 2007, 6:15 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: Messy Code - To refactor or not to refactor

If you're going to lose your client over a weeks worth of work, lose him. Next time pick a client who wants good work, not one who wants to pay you less than a McDonald's burger-flipper.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 27th, 2007, 6:16 PM   #4
null_ptr0
11 years old
 
Join Date: Nov 2007
Posts: 79
Rep Power: 1 null_ptr0 is on a distinguished road
Re: Messy Code - To refactor or not to refactor

Refactoring is a good thing; get into the use of it.
__________________
iload_0 iconst_1 ishl or
iload_0 iconst_2 idiv or
iload_0 iconst_2 iconst_1 imul idiv
[1] & [2] use the smallest stack size
null_ptr0 is offline   Reply With Quote
Old Nov 27th, 2007, 8:00 PM   #5
MiKuS
Programmer
 
Join Date: Jun 2007
Posts: 93
Rep Power: 2 MiKuS is on a distinguished road
Re: Messy Code - To refactor or not to refactor

I took DaWei's advice and detailed the problem I had, they didn't want to hear about it so I've ditched them.

Probably better off I dropped them anyway.

Thanks for the help.
MiKuS is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewing VB's Automated code john Wesley Visual Basic .NET 3 Jun 8th, 2006 5:37 AM
FTP and return code fetching Serinth C 2 May 28th, 2006 11:05 PM
String to Morse Code - Copying from string to string Xenon C 29 Nov 10th, 2005 2:30 PM
Code Reading Tips linuxpimp20 Other Programming Languages 4 Sep 8th, 2005 3:53 PM
Code suggestions Mad_guy Perl 0 Feb 18th, 2005 10:31 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC