Andrew Mobbs (mobbsy) wrote,
Andrew Mobbs

It's been a while since I was last a full time programmer, but it seems I've still something of the mindset. I've had a bit of code to write for work that's been a bit awkward for a few days, this evening at something of a loose end I had a look at it. I don't usually do much work out of hours, but there were deadlines, and I seemed to be in the right frame of mind.

Ah... it then turned into one of those times where you've solved the piece of the puzzle and everything just starts dropping into place. "Ah ha! I pulled that code into a separate function because I'd used nearly the same code twice, and that's just good practice. Now I see if I just add one more parameter to that function, and recode it a bit here it becomes general enough that I can reuse it to do that job everywhere".

OK so "recode it a bit here" meant turning a simple SQL statement into something that dynamically generates the SQL depending on the parameters, which is somewhat unpleasant, but still the best solution I could think of as it minimised code replication.

It's been a while since I last got the puzzle-solving programming buzz, I miss it. (Though not enough to want to go back to programming for a living, I'm too sloppy to be able to consistently write good code.)

  • (no subject)

    Last week I poured the cremated remains of my father into a river. From there, that material will flow through the town he lived in, into the sea,…

  • Moving house!

    We're moving house soon… details to follow in a less public post, or email me. However, we're getting rid of some bits and pieces of…

  • (no subject)

    Yesterday, I made sausages. This was sufficiently exciting to cause me to actually write something on LJ for once. One of our wedding gifts was a…

  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment