Start from scratch?
-
wout de zeeuw wrote:
have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch?
Only if what was there, just flat-out didn't work. Regardless if the code is sloppy, doesn't follow standards and/or is poorly implemented/designed, if it works ... it works. It is my personal and professional opinion, that it is better to refactor portions of the code base, bringing the project "up to spec", than to ditch a working project and start over ... My two cents. [ I did fail to mention that this applies only to projects that are in the field. if the project hasn't been released, and there isn't a mission critical dead-line that must be met, by all means, kill it off and start over ] -- modified at 12:36 Wednesday 31st January, 2007
:..::. Douglas H. Troy ::..
Bad Astronomy |VCF|wxWidgets|WTLDouglas Troy wrote:
if the project hasn't been released, and there isn't a mission critical dead-line that must be met, by all means, kill it off and start over
He! Like Vista? :-D
________________________________________________ Personal Blog [ITA] - Tech Blog [ENG] - My Photos Developing ScrewTurn Wiki 2.0 (2.0 Beta is out)
-
wout de zeeuw wrote:
have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch?
Only if what was there, just flat-out didn't work. Regardless if the code is sloppy, doesn't follow standards and/or is poorly implemented/designed, if it works ... it works. It is my personal and professional opinion, that it is better to refactor portions of the code base, bringing the project "up to spec", than to ditch a working project and start over ... My two cents. [ I did fail to mention that this applies only to projects that are in the field. if the project hasn't been released, and there isn't a mission critical dead-line that must be met, by all means, kill it off and start over ] -- modified at 12:36 Wednesday 31st January, 2007
:..::. Douglas H. Troy ::..
Bad Astronomy |VCF|wxWidgets|WTLThanks for your view douglas, you're reassuring that we're on the right track restructuring gradually (the project is out in the field). It's not easy though! But restarting from scratch is a huge risk to take.
Wout
-
I'm working on a fairly big project, and like always it has its legacy code. Unfortunately it's based on legacy code of about a year's work by somebody that was not great at (.NET) programming, let alone architecting and designing it. The whole thing is currently operational, but it's not structurally sound. The pricing structure in the application hard to understand, and has its flaws. The database and web service design are just in the state that things work most of the time, but they have their issues and the design is not good. So the dilemma is, should we start from scratch? I've been telling the company's president that hires me, not to do that, that it would be the biggest mistake ever. The reasoning being taking smaller steps towards a sound structure involves much and much less risk, and we can still gradually move towards this goal. I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch. So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch? What has been your success/fail ratio on this approach? I'm still resisting the urge to start from scratch, it seems so appealing when working with the crappy code.
Wout
Calculate time, costs and benefits. Remember the triangle of software development (time/feature/resources) what in truth is a rectangle (time/feature/resources/quality).
:sigh: Still searching for a good resource to LEARN English grammar ... :~
For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.(John 3:16) :badger: -
I'm working on a fairly big project, and like always it has its legacy code. Unfortunately it's based on legacy code of about a year's work by somebody that was not great at (.NET) programming, let alone architecting and designing it. The whole thing is currently operational, but it's not structurally sound. The pricing structure in the application hard to understand, and has its flaws. The database and web service design are just in the state that things work most of the time, but they have their issues and the design is not good. So the dilemma is, should we start from scratch? I've been telling the company's president that hires me, not to do that, that it would be the biggest mistake ever. The reasoning being taking smaller steps towards a sound structure involves much and much less risk, and we can still gradually move towards this goal. I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch. So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch? What has been your success/fail ratio on this approach? I'm still resisting the urge to start from scratch, it seems so appealing when working with the crappy code.
Wout
A common problem with 'legacy code' is Dependency Injection. This is when you have classes that rely too much on other classes, and THAT makes refactoring (fixing) code very tough. I'd start by getting rid of dependency injection, and just refactor bit by bit. As long as you take small steps, and don't actually change what the code is doing, you'll probably be ok.
-
I'm working on a fairly big project, and like always it has its legacy code. Unfortunately it's based on legacy code of about a year's work by somebody that was not great at (.NET) programming, let alone architecting and designing it. The whole thing is currently operational, but it's not structurally sound. The pricing structure in the application hard to understand, and has its flaws. The database and web service design are just in the state that things work most of the time, but they have their issues and the design is not good. So the dilemma is, should we start from scratch? I've been telling the company's president that hires me, not to do that, that it would be the biggest mistake ever. The reasoning being taking smaller steps towards a sound structure involves much and much less risk, and we can still gradually move towards this goal. I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch. So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch? What has been your success/fail ratio on this approach? I'm still resisting the urge to start from scratch, it seems so appealing when working with the crappy code.
Wout
The product I'm working on took the start from scratch approach and spent 3 years on a complete rewrite, and then spent the last year merging that rewrite in with the existing product because they couldn't manage to get the rewrite under control. So now there is a combination of existing tested poorly written code merged in with a huge mass of slightly cleaner untested code all pushed out the door to get some benefit from the time spent on the re-write. So, only go with a re-write if you absolutely have to, there are things that are much worse then starting from bad code and making it better.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you. -Chris Maunder
-
The product I'm working on took the start from scratch approach and spent 3 years on a complete rewrite, and then spent the last year merging that rewrite in with the existing product because they couldn't manage to get the rewrite under control. So now there is a combination of existing tested poorly written code merged in with a huge mass of slightly cleaner untested code all pushed out the door to get some benefit from the time spent on the re-write. So, only go with a re-write if you absolutely have to, there are things that are much worse then starting from bad code and making it better.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you. -Chris Maunder
Aaaah, that's the kind of horror story I was looking for! :laugh: That makes me feel a lot better!
Wout
-
If it's modular enough to fix incrementally, then do that. If the current problems cannot be fixed without touch every other aspect of the system, consider first that an investment into unit testing the whole thing will pay off much more than a rewrite. You'll know what you break by patching, and you can ultimately use the same unit tests to tests a rewrite. Starting from scratch doesn't fix old problems, it creates new ones. The only way to overcome that is with a test first approach to the development. Otherwise, you'll end up a year from now in the same room, just with different wallpaper. And another piece of sage advice is, don't develop concrete code against an abstract specification. Develop abstracted, modular code against a concrete requirement. Marc
People are just notoriously impossible. --DavidCrow
There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh SmithGood one... we don't have any testing in place yet. I'm gradually massaging everybody to see the need for unit testing. I have noticed things that were not right in the code/design, but still we had to release because of time pressure. And my thinking has been that at least they will see that the software has a lot of problems, so as a result they will see the need for unit testing hopefully.
Wout
-
If it's modular enough to fix incrementally, then do that. If the current problems cannot be fixed without touch every other aspect of the system, consider first that an investment into unit testing the whole thing will pay off much more than a rewrite. You'll know what you break by patching, and you can ultimately use the same unit tests to tests a rewrite. Starting from scratch doesn't fix old problems, it creates new ones. The only way to overcome that is with a test first approach to the development. Otherwise, you'll end up a year from now in the same room, just with different wallpaper. And another piece of sage advice is, don't develop concrete code against an abstract specification. Develop abstracted, modular code against a concrete requirement. Marc
People are just notoriously impossible. --DavidCrow
There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh SmithOooh, while you mentioned it, we're doing client app, web service, db. Would you happen to know a good way of unit testing this chain? I have done a lot of NUnit testing, but not that much that crossed several processes (or machines). (IIS 6 don't run on windows XP, so that's inconvenient too).
Wout
-
I'm working on a fairly big project, and like always it has its legacy code. Unfortunately it's based on legacy code of about a year's work by somebody that was not great at (.NET) programming, let alone architecting and designing it. The whole thing is currently operational, but it's not structurally sound. The pricing structure in the application hard to understand, and has its flaws. The database and web service design are just in the state that things work most of the time, but they have their issues and the design is not good. So the dilemma is, should we start from scratch? I've been telling the company's president that hires me, not to do that, that it would be the biggest mistake ever. The reasoning being taking smaller steps towards a sound structure involves much and much less risk, and we can still gradually move towards this goal. I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch. So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch? What has been your success/fail ratio on this approach? I'm still resisting the urge to start from scratch, it seems so appealing when working with the crappy code.
Wout
Like anything it's whatever is appropriate to the situation. The only major project I redid from scratch is a very large commercial application we built and had been selling for many years. It was originally written in mfc / c++ and when it came time to add a lot of new features for a major new version I decided that it was better done in .net and so then had the opportunity to redo it from scratch. In your case it really depends on how messed up the original one is, but I disagree with Joel in that there are definitely times when it makes more sense to redo from scratch, but in your case it really depends on how messed up the original is.
-
Like anything it's whatever is appropriate to the situation. The only major project I redid from scratch is a very large commercial application we built and had been selling for many years. It was originally written in mfc / c++ and when it came time to add a lot of new features for a major new version I decided that it was better done in .net and so then had the opportunity to redo it from scratch. In your case it really depends on how messed up the original one is, but I disagree with Joel in that there are definitely times when it makes more sense to redo from scratch, but in your case it really depends on how messed up the original is.
We're in .NET 2.0, IIS 6, SQL server 2000. In all honesty, there's not a single problem I don't think we can restructure in at most 2 weeks time. Though it feels shitty, it is probably the best path to progress. Actually I'd be pretty happy when we can release an improved version every 2 weeks. On most items we can probably release quicker.
Wout
-
wout de zeeuw wrote:
I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch.
Another one worth reading, IMHO is The Big Rewrite.[^]
Ah, pretty good one too (though I always find Joel's reasoning very clean cut).
Wout
-
We're in .NET 2.0, IIS 6, SQL server 2000. In all honesty, there's not a single problem I don't think we can restructure in at most 2 weeks time. Though it feels shitty, it is probably the best path to progress. Actually I'd be pretty happy when we can release an improved version every 2 weeks. On most items we can probably release quicker.
Wout
Well that sounds like an incremental approach should be taken then. To me the only showstopper that would prompt a re-write in your case is if the app was not properly stratified in it's design with the UI layer being separated cleanly from the actual guts of the program in another layer below. I would never work with a monolithic design ever again, that way lies madness. :)
-
I'm working on a fairly big project, and like always it has its legacy code. Unfortunately it's based on legacy code of about a year's work by somebody that was not great at (.NET) programming, let alone architecting and designing it. The whole thing is currently operational, but it's not structurally sound. The pricing structure in the application hard to understand, and has its flaws. The database and web service design are just in the state that things work most of the time, but they have their issues and the design is not good. So the dilemma is, should we start from scratch? I've been telling the company's president that hires me, not to do that, that it would be the biggest mistake ever. The reasoning being taking smaller steps towards a sound structure involves much and much less risk, and we can still gradually move towards this goal. I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch. So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch? What has been your success/fail ratio on this approach? I'm still resisting the urge to start from scratch, it seems so appealing when working with the crappy code.
Wout
Do you have the analysis, requirments and specification documentation from the original effort? If that work was not previously performed then you have no choice but to start from scratch. Otherwise if you have all those artifacts a short period to verify their accuracy should suffice and a completely new implementation with modifications to design should not be difficult nor time consuming.
led mike
-
Well that sounds like an incremental approach should be taken then. To me the only showstopper that would prompt a re-write in your case is if the app was not properly stratified in it's design with the UI layer being separated cleanly from the actual guts of the program in another layer below. I would never work with a monolithic design ever again, that way lies madness. :)
He, we're not quite there yet! Still got some logic in the UI layer indeed, but we already moved quite some of that into the data layer. :rolleyes:
Wout
-
Do you have the analysis, requirments and specification documentation from the original effort? If that work was not previously performed then you have no choice but to start from scratch. Otherwise if you have all those artifacts a short period to verify their accuracy should suffice and a completely new implementation with modifications to design should not be difficult nor time consuming.
led mike
No, no and no unfortunately. However the systems isn't of such proportions (yet) that we don't know what it should do or figure it out by spending 2 days of staring at code. So the approach I'm taking now is gradually get consistent documentation up.
Wout
-
Oooh, while you mentioned it, we're doing client app, web service, db. Would you happen to know a good way of unit testing this chain? I have done a lot of NUnit testing, but not that much that crossed several processes (or machines). (IIS 6 don't run on windows XP, so that's inconvenient too).
Wout
wout de zeeuw wrote:
Would you happen to know a good way of unit testing this chain?
The thing people forget (and me too) is that unit testing is supposed to test the most fundamental units. I guess I'd start there. But you'll also need to make use of mock objects, which unfortunately requires an architecture that lets you swap out the real object with a mock one--object factories and code that uses interfaces, in other words. I suspect the programmer did not design the code (nor implement it) with unit testing and mock objects in mind. If you don't have that, you can't use mock objects effectively, and you can't test higher level functionality effectively. Which leaves you with creating test data and having the unit tests coordinate their activities across system boundaries. You'll probably write as much, if not more code than the original system going that route. Marc
People are just notoriously impossible. --DavidCrow
There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith -
I'm working on a fairly big project, and like always it has its legacy code. Unfortunately it's based on legacy code of about a year's work by somebody that was not great at (.NET) programming, let alone architecting and designing it. The whole thing is currently operational, but it's not structurally sound. The pricing structure in the application hard to understand, and has its flaws. The database and web service design are just in the state that things work most of the time, but they have their issues and the design is not good. So the dilemma is, should we start from scratch? I've been telling the company's president that hires me, not to do that, that it would be the biggest mistake ever. The reasoning being taking smaller steps towards a sound structure involves much and much less risk, and we can still gradually move towards this goal. I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch. So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch? What has been your success/fail ratio on this approach? I'm still resisting the urge to start from scratch, it seems so appealing when working with the crappy code.
Wout
In my 20+ years engineering experience I've found it to be universally true - patching a broke system will only cost more in the long run. A bad design doesn't get better when someone 'fixes' it. Always start over, learning from the bad first try what not to do. There are no exceptions I've ever seen or heard reported by a reasonably sober witness.
"...a photo album is like Life, but flat and stuck to pages." - Shog9
-
wout de zeeuw wrote:
Would you happen to know a good way of unit testing this chain?
The thing people forget (and me too) is that unit testing is supposed to test the most fundamental units. I guess I'd start there. But you'll also need to make use of mock objects, which unfortunately requires an architecture that lets you swap out the real object with a mock one--object factories and code that uses interfaces, in other words. I suspect the programmer did not design the code (nor implement it) with unit testing and mock objects in mind. If you don't have that, you can't use mock objects effectively, and you can't test higher level functionality effectively. Which leaves you with creating test data and having the unit tests coordinate their activities across system boundaries. You'll probably write as much, if not more code than the original system going that route. Marc
People are just notoriously impossible. --DavidCrow
There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh SmithGood thinking Marc, I had not thought along these lines yet. Thanks.
Wout
-
I'm working on a fairly big project, and like always it has its legacy code. Unfortunately it's based on legacy code of about a year's work by somebody that was not great at (.NET) programming, let alone architecting and designing it. The whole thing is currently operational, but it's not structurally sound. The pricing structure in the application hard to understand, and has its flaws. The database and web service design are just in the state that things work most of the time, but they have their issues and the design is not good. So the dilemma is, should we start from scratch? I've been telling the company's president that hires me, not to do that, that it would be the biggest mistake ever. The reasoning being taking smaller steps towards a sound structure involves much and much less risk, and we can still gradually move towards this goal. I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch. So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch? What has been your success/fail ratio on this approach? I'm still resisting the urge to start from scratch, it seems so appealing when working with the crappy code.
Wout
Seeing as it is already being used, I'd have to say you are making the right decision going with incremental improvements. I know how tempting it can be to just start from scratch when dealing with someone else's code though. In fact, I ended up doing exactly that on my last project. However, it was an abandoned project that had not ever been released. The previous "developers" sneaked out the back door after realizing that maybe getting some actual training might be a good idea. Unfortunately, the client was under the impression that the project was very close to production worthy. It had a nice interface and most of it worked. Needless to say, he was very surprised by my recommendations after evaluating the existing system to either cut his losses or start over. The end result was a success and a very satisfied client but only because we treated the project as though it had never existed. Had the client requested that any of the existing code be reused, I would have respectfully declined the contract. It was that bad.
-
I'm working on a fairly big project, and like always it has its legacy code. Unfortunately it's based on legacy code of about a year's work by somebody that was not great at (.NET) programming, let alone architecting and designing it. The whole thing is currently operational, but it's not structurally sound. The pricing structure in the application hard to understand, and has its flaws. The database and web service design are just in the state that things work most of the time, but they have their issues and the design is not good. So the dilemma is, should we start from scratch? I've been telling the company's president that hires me, not to do that, that it would be the biggest mistake ever. The reasoning being taking smaller steps towards a sound structure involves much and much less risk, and we can still gradually move towards this goal. I also read a really good blog note by Joel ("Things you should never do, part I"[^]), confirming my views on not starting from scratch. So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch? What has been your success/fail ratio on this approach? I'm still resisting the urge to start from scratch, it seems so appealing when working with the crappy code.
Wout
wout de zeeuw wrote:
So I'm wondering, have any of you guys thrown away the existing stuff (reasonably sized project) and started from scratch?
I have done that with the project I am working on now. Although its not huge and some of the previous code will be use with only little modifications. Its a few thousand lines or more of code. Not very big. It may end up being over 6k lines. Sometimes its better to start from scratch, the new version of my project used a completely different architecture that would require major work to rework the old code, more than building from scratch.
█▒▒▒▒▒██▒█▒██ █▒█████▒▒▒▒▒█ █▒██████▒█▒██ █▒█████▒▒▒▒▒█ █▒▒▒▒▒██▒█▒██