Slashdot Mirror


When Rewriting an App Actually Makes Sense

vlangber writes "Joel Spolsky wrote a famous blog post back in 2000 called 'Things You Should Never Do, Part I,' where he wrote the following: '[T]he single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch.' Here is a story about a software company that decided to rewrite their application from scratch, and their experiences from that process."

7 of 289 comments (clear)

  1. There are times for a rewrite and port. by AnonymousClown · · Score: 4, Insightful
    The article was interesting in how they made their decision and I don't think it was necessarily a bad decision - assuming their assessment of the old version was correct. The process looked like it broke down in the design and planning phases. The article didn't go into detail on the design and planning; which kind of leads me to believe that may have tried to do the "superstar" programmer thing and rewrite it over a weekend. Anyone whose been in development long enough has heard the "he coded it over the weekend"stories and the programmer "street cred" it gave - at least back then.

    I've seen rewrites/ports go quite well. Systems that were originally on mainframes and needed or wanted to be moved to cheaper hardware for cost - if it was the proper thing to do (Sometimes you really need the metal).

    Another rewrite that went well was a bunch of code that over the decades became so convoluted to be a maintenance nightmare - modify one thing or add on functionality and then break a shit load of other things.

    Just do these basica things and it'll work out.

    Go back to the specs and start there.

    Talk to the stake holders - yep, there will be creep but also feature reduction because there are things that they never used or because it doesn't make sense anymore.

    Plan, plan, plan. No cowboy programming and hacking out shit. And document everything.

    It can work.

    --
    RIP America

    July 4, 1776 - September 11, 2001

  2. Re:Here's my short list by Tanktalus · · Score: 5, Insightful

    Regarding regexes, I've gone both ways: I've had my developers remove regexes where they were trying to use them, and I've had them add regexes where they were trying too hard to avoid them. Regexes aren't the answer, they're a single tool. You need to use them right. And the /x modifier in Perl helps a lot, allowing you to put useful whitespace and comments in the code (and a regex is code as much as any other language).

    As for "as few lines as possible" - you need to do it right. When you span your code over 3 pages, that's not readable anymore. I harp on this with my developers all the time: SCOPE. Scope applies to variables, comments, and functions. The less I need to look at to understand what you're doing, the more likely it is I'm going to understand it. A huge 3-page if-elseif-elseif-else is going to be something I'm not going to understand, as I'll have forgotten all the conditionals by the time I get to the end to know really what scenarios are left - sequential access. A concise regex, on the other hand, is something that I can skim over just by moving my eyes - random access. These concerns aren't just valid for storage media (tape vs DVD/HD). Of course, 40 characters of regex special characters with no whitespace (either horizontal or vertical, preferably both) is generally going to overwhelm most readers, and is going stupid in the other direction.

    Yes, readability trumps length of code. But sometimes that means to use a regex (or two or three - why make one big cryptic one when multiple simpler regexes can do the job?). And sometimes, that means avoiding them when what you really want to do is better done by another piece of code.

    My favourite new-to-regex example recently has been someone trying to pull apart colon-delimited text with a regex. Woops - there are better language constructs for tokenisation, whether that's strtok in C or it's split in Perl (or better, Text::CSV_XS). Got rid of that regex in a hurry.

  3. Re:And why? by WrongSizeGlass · · Score: 3, Insightful

    I'm going to forward your blog post to several clients and colleagues. The clients need to see why I make sure they know what they want before we start development (they never understand how hard it is to change infrastructure on the fly or just "do it again"), and the colleagues because they need to stop selling one product as something else that can "do what you need with just a little bit of tweaking".

    We do some small custom web apps for clients, and even a few that have the potential to grow into bigger (but not big) products. While rolling out one of them this week, to the first of three clients who have ordered it, I'm already designing a complete re-write of the core of this product. What started out as a small helper app for one client has turned into a PITA to scale up and out for these other clients. Clearly it's better to fix it now than to keep patching & splicing in order to make it work for them ... until we sell it to someone else who wants "just one little change ...".

  4. Re:Ugh by drinkypoo · · Score: 3, Insightful

    The original rewrite of MacOS was Copland, which used up Apples development resources for five years before it was cancelled.

    Yeah, I remember that, it's what convinced me to stop being a Mac user. I had the INIT or CDEV or whatever that made your MacOS look like Copland. Then they cancelled it and brought out another shitty MacOS, and I ran like hell and never looked back. All the years from System 7 through System 9 were sad, abusive times to be an Apple customer. They kept bringing out inadequate hardware at astounding prices and almost spent all their cachet. Another year or two and they wouldn't have had enough fans left to float OSX.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  5. Re:Here's my short list by Surt · · Score: 5, Insightful

    You should think about investing in learning tools. Regex is a well documented, well understood, capable feature of all modern languages. How many weeks will you spend debugging / refining your thousands of if/then/else when you could trust years of testing that has been done on regex engines? Your statement reminds me of novices who avoid ?: in favor of if/else because it's 'cryptic'.

    --
    "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  6. Re:Here's my short list by WDot · · Score: 3, Insightful

    You could just put in a comment that says "This regex tests for an email address."

    I've massaged if-else code into regexes before. Having several if-elses for a piece of data is rickety and (in my opinion) would take more work to rework than a regular expression if the data changed.

  7. Re:Missing the point by St.Creed · · Score: 4, Insightful

    Whenever I hit my thumb, I blame the stupid hammer as well.

    Or, in other words: a fool with a tool is still a fool.

    You can use assembly and have decent code, with clear separation of concerns. Or you can have a 4GL programming tool and still make a mess. Which is exactly why some programmers are 10 times more productive than others.

    So where I worked we had ASP+VBScript (supplemented with VB6 COM+ modules running with transactional integrity on an Oracle database) and clean modules, separation of concerns and code that we could easily understand and maintain (even the junior programmers had no trouble getting used to it in a few weeks). We built most of the business apps in the last place I worked on such a design. It still works, is very easy to maintain and transfers cleanly to IIS 8 and Windows 2008. All our database code is in a single (small) module, same as the business layers. Presentation layers is a bit more complex but when transferred to .NET you can just get rid of it altogether because .NET takes over that part. Which is exactly what is happening now, ofcourse.

    Don't blame the tools for the lack of ability of most programmers.

    --
    Therefore, by the (faulty) logic you're using, you're just a cow with a keyboard - osu-neko (2604)