Douglas Milewski (dacuteturtle) wrote,
Douglas Milewski
dacuteturtle

Rewriting Code

I am rewriting some VBA code from a year or so ago. I finally have time to review it and add new features. BUT FIRST, if have to fix all of my crap code. I was in a "GET IT DONE" mode when I wrote the code, and some if it is just slow, Slow, SLOW, or bad, Bad, BAD.

Slowly getting speed out of this danged thing. Also uncovering errors, and finding the Select statement mighty useful.

In theory, I could  have done this job the first time, but I did not understand the problem quite well enough to make the code work well. This time, I understand the sorting and purpose of all this data messaging far better. With a clearer view of the problem, the solutions are far easier.

I am mainly doing this as I need to track more stuff, which means turning on the data spigot even more, and that means having to account for more variation, and that means rethinking lots of stuff.

As I am rewriting things, I am also making the code less breakable. When I first wrote this, it broke just because. Some of the rewriting simplified the logic, so I don't get the same kind of breakage.

For the new code, I will be doing the "get it working, then figure out how to do it" dance again. Just because there is a good way to do it doesn't mean that I know the answer right now. I'm only an occasional coder. Finding the right solutions is far more time consuming than brute-forcing a solution.

Lack of time. It makes bad coders out of all of us because you get stuck on the obscure stuff, not the stuff you know.
Subscribe

  • Moving to DreamWidth

    For those heading to DreamWidth, I've created an account. I'm dmilewski.

  • Prostitution as a Means of Family Planning

    Does prostitution constitute a method of family planning? If a man doesn't want more children, then instead of having sex with his wife, he has sex…

  • The Swordbearer (1982)

    The Swordbearer (1982) by Glen Cook is the dark fantasy version of a YA novel. If you know Glen's writing style, you'll recognize the disaster about…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments