Streamlining Code

Discussion in 'The Basics of Software' started by Dan Allen, Dec 7, 2016.

  1. Dan Allen

    Dan Allen Administrator Founder Not Banned Radio Button Problem - Leader

    I used to have to replace the quiz script when copying the quiz directory between solar and hwc. Not anymore.

    upload_2016-12-7_8-59-58.png


    That is what I was going to show you but then
    upload_2016-12-7_9-1-2.png

    upload_2016-12-7_9-4-56.png

    upload_2016-12-7_9-2-45.png

    upload_2016-12-7_9-9-37.png

    Fixing the portability problem and eliminating duplicated code that was produced in the process makes this a good change. The duplicated code was the two versions of the the survey funnel script that are different by only one number. Heck the numbers were 12925 and 12926, so we could have eliminated the duplication of the 1292, but that seemed too far, because then we would have to redo this code if the next time we put in a survey funnel script its campaign number did not start with 1292. We have a similar exposure to the fact that survey funnel could change their scripts. So, a line had to be drawn somewhere. It would be reasonable to consider the survey funnel scripts atomic, i.e., unchangeable by us, which is the way I had it in the first image in this thread

    I discovered yesterday that boiling the code down like this is called refactoring. It means exactly what you can see happening here. Eliminating duplicate code, making it more portable, any improvement that does not effect what the system does from perspective of people using the system. The improvement is it is easier and more efficient to work on. Faster does not count as a change in this context. but it can be another significant benefit. The thing that is not changing here is the functional behavior. The term I usually use, instead of refactoring is streamlining.
    Sometimes it is possible to streamline while adding features (adding features changes functional behavior). It’s good to recognize the distinction between streamlining and other kinds of changes. If we are not streamlining enough as we develop, the system will become unmanageable. That is worse than bad. Unmanageable is our #1 arch enemy. It is easy to reach unmanageability. Everything we do has to a measure of anti-unmanageability or it will overwhelm us quickly. At the moment we are quazi-unmanageable on Holly’s blog. That situation is perfectly correctable and it is not really unmanageable. The problem on Holly’s blog is I am a bottleneck holding up everyone else’s ability to contribute.
     

Share This Page