The trouble with getting better at things

Is that by the time you get towards the end of a project you look back at the start and wonder what the hell you were doing. Two months ago I started a new job and learnt Python from scratch. A week or so into it I moved on to making a GUI and had to go through the learning process all over again.

My first tentative steps carried me through single buttons that said “Hello World” when you poked them, to popup windows whenever you pressed anything. The first rendition of my program was a mess. The first parts of it had some of the most inefficient code I’ve seen looking back at it. Everything was repeated for every element of each page and actions were carried out as one huge long procedural code block.

As I went along I got to the stage where something worked then moved onto the next, each time figuring out a better way of doing things. Single functions in loops paved the way for a whole lot less code and much easier debugging when things inevitably went wrong.

Slowly I got to the stage where my various superior people took copies and tried and tested it. Things were suggested and alterations were made. When these took me back to the first stuff I wrote, a small part of me died inside.

I’d obviously not done anything as useful as comment on anything. The only guidance as to what I’d been thinking was the string of “if debug: print(‘[Something is happening here]’)”s weaving through pages of solid code repeating itself through swathes of randomly named variables that had handily shortened names because I would obviously not forget what I was thinking. Right?

So when I was faced with such a wall of confusion, I did the only sensible option and started again from the beginning with a new plan and a big copy and paste stick.

This time it was the new and improved version. No more did new windows open for everything. No more do pages run off the page. The screen resolution no longer causes problems (“It’s fallen off the screen I can’t get it to do anything”). It’s almost looking like a program should. Or it would do if it wasn’t for the colour scheme. As part of the new thinking behind this version, things have been grouped together on the page so that functions can act on them all at once. To let me see where one group starts and another stops I have employed various colours. It was an appearance described as hideous, ugly and vile. I assume that’s not a selling point.

As I ran out of the standard “red”, “blue”, “green” etc I looked up what other named colours linux offers and found this list of named x11 colours to save the bother of figuring out hex codes as I went along. And I was thinking I’d run out soon. I think I’m safe on that front. Who knew ‘Dark Goldenrod’ (#B8860B) and ‘Peru’ (#CD853F) were even colours? I wonder what sort of situation would have people deciding and arguing over the merits of ‘papaya whip’ (#FFEFD5) when compared to ‘Lemon Chiffon’ (#FFFACD) and ‘Linen’ (#FAF0E6). This was a whole new world I’d discovered.

It turns out there are more than sixteen colours after all. Who knows what I’ll find out tomorrow?

Advertisements
Categories: No NaNoWriMo, Work | Tags: , , , , , | Leave a comment

Post navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: