Possible Duplicate:
Prototyping vs. Clean Code at the early stages
I'm right in front of a difficult decision.
I have a problem in my codebase (it's in C++), which I could solve in two ways:
- A) Add one line of code
- B) Rewrite ~7500 lines of code, adding roughly 1000 for an additional messaging switchboard class
Now, at that point any sane person would probably tell me to chose A, but:
Solution A would be hacky. In my case what I mean by this is that it would:
Involve adding coupling between two classes that normally shouldn't know of each other, and shouldn't interact except over an external manager class
Lower flexibility
Cause future classes in the same league to have the same problem, thus creating more hackyness if the solution isn't changed
I'm sorry for the lack of concrete information, but explaining my situation probably would take 1,5 A4 pages of paper - and the decision is really a general one.
So, what do you think:
- Should I choose solution A or B?
- How hacky are things allowed to get in a project where clean and logical code plays a great role?
- Are there any general guidelines on avoiding the phenomenom of "hacky code"?