Rewrite Your Code Tomorrow

  • Dalkeith - Thursday, October 5, 2017 7:31 AM

    I ve been fortunate enough to have redesigned sections of some of my systems periodically over the years mainly because the systems have been successful and the remit has expanded or because I simply have learnt or been told about a better way of doing something. There are some technical debt parts that start to annoy me as well and I end up working on them outside of work as they just are seriously bugging me. I found it a good exercise with VBA to have some practical examples of loops and recordsets and try and write them semi rote over and over and see if I can't do them really quick.

    I try and generalise some of my code and write it to a diary as well - I find that useful for reviewing and really getting to grip with certain aspects of my code. I did think about trying to write my own application to hold this but wordpress really seems to be far better than anything I could probably put together.

    I know what you mean about not needing to improve on something like WordPress. I know some people who would rather spend lots of time re-inventing the wheel, rather than just using what's already there.

    Kindest Regards, Rod Connect with me on LinkedIn.

  • LightVader - Wednesday, October 4, 2017 6:39 AM

    mjh 45389 - Wednesday, October 4, 2017 4:43 AM

    I would dearly like to revisit some code that works but could be better written and/or made more efficient. At the moment I am having to modify a program to add in something that was not in the original requirements. The structure is all wrong for the new feature but I do not have the time redo this and have said I feel like I am adding an illegal extension to a house!  🙁

    I have the same feeling.  I have a project that I completed a few years ago that I would love to overhaul.  I was learning a new development methodology as I developed the project and you can tell when you look at the code.  The sections that I wrote towards the end of the project are significantly better than those I wrote at the beginning.

    I also really like your analogy.  I may have to borrow that one. 😀

    Well the extension is lacking services so the house needs a secret room with a data conduit to the extension! In reality the software is nearing the end of its lifecycle and needs a total rewrite with a clear set of requirements! The patching continuers!

  • mjh 45389 - Friday, October 6, 2017 10:00 AM

    LightVader - Wednesday, October 4, 2017 6:39 AM

    mjh 45389 - Wednesday, October 4, 2017 4:43 AM

    I would dearly like to revisit some code that works but could be better written and/or made more efficient. At the moment I am having to modify a program to add in something that was not in the original requirements. The structure is all wrong for the new feature but I do not have the time redo this and have said I feel like I am adding an illegal extension to a house!  🙁

    I have the same feeling.  I have a project that I completed a few years ago that I would love to overhaul.  I was learning a new development methodology as I developed the project and you can tell when you look at the code.  The sections that I wrote towards the end of the project are significantly better than those I wrote at the beginning.

    I also really like your analogy.  I may have to borrow that one. 😀

    Well the extension is lacking services so the house needs a secret room with a data conduit to the extension! In reality the software is nearing the end of its lifecycle and needs a total rewrite with a clear set of requirements! The patching continuers!

    In my case, the application is only a toddler.  I'm trying to get some architecture changes done when I do fixes.  It's a lot slower this way, but I will get to change the application eventually.



    The opinions expressed herein are strictly personal and do not necessarily reflect the views or policies of my employer.

  • I came across this article after about 50 views, according the stats on the website.  At that time, this article only had about 3 stars.  Considering all the great comments in this discussion, I can only imagine that the larger collection of people that read the article are lurkers that actually do think they write perfect code first time every time.  Pretty much matches what I've found in the last 10 years of interviews.

    Anyway, really good article, Steve.  I wish that more people would spend more time learning from even their own code and trying some new things.  Experimentation leads to innovation and a better understanding the next time around. 

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Plenty of times I've read through code and thought "which idiot wrote this?" and then think - "Oh I guess its this idiot!"
    There are a few reasons firstly over time we identify different ways to do something and hopefully recognise the shortcomings of some of them which we may have used before learning about the alternatives.
    Another issue is that when developing new functionality the requirements are frequently constantly changing and the architecture chosen on the basis of the early specs may be suboptimal once the requirements have changed to that which will be released.
    After release we will start to get user feedback and support incidents referring to issues which were never considered in the initial design and these can be considered in a rewrite.
    We also are heavily pressured in terms of time and changing the architecture of the solution is usually seen as likely to mean a big delay, delays from maintaining the existing code are again usually perceived as being less even where this isn't actually the case and the extra work involved in persuading management that a rewrite will be better often outweighs the perceived benefit.

Viewing 5 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply