Click here to Skip to main content
15,896,269 members

Rewrite or...?

Source: CodeProject     Posted by Kent Sharkey    Thursday, September 8, 2022 6:00pm    
"Nuke the entire site from orbit. It's the only way to be sure"

I have this customer who has this 20 year old web application.



Back to all news items

 
General20 years old isn't necessarily bad Pin
bantling9-Sep-22 1:49
bantling9-Sep-22 1:49 
It depends on how good the code is. For example, if it is a Java app it may use JSP to provide the web pages to the browser. JSP allows including other JSP pages so that common functionality can be factored into a common include. Unfortunately, people commonly over used includes to the point that if you modified an included file who knows what all pages you've affected.

By the same token, the business logic code might suffer from a number of common convoluted patterns, such as the "many wrappers" pattern, where a provider wraps a Service that wraps a Generator that wraps ..., ad nauseum.

The point being, if you think the code needs rewriting, justify it. Examine the code in enough detail to list one or more bad patterns that make code very hard to work with, and the benefit gained from rewriting it.

I did this once in my career. I explained that the code had a bunch of "routing" methods - they work like your ISP router: they check the parameters to determine which caller invoked the method, then called out to other methods that would do what that caller needs.

At one point when I was talking to a tester, I suspected that way too much testing was being done because of this, and the tester told me 40 hours of testing was being done for every change.

I explained to the manager that this is why the code is a minefield - you never know what you're going to break on some seemingly unrelated screen when you make a change, and that there is no simple way to resolve this issue, that the code needed a rewrite. I ended by saying that we should not need to do 40 hours of testing for every change. When I made that last statement, the manager had this "holy crap, why didn't someone say this earlier?" look on his face.

The company decided to do a rewrite.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.