T-SQL Tuesday #164: Code that made you feel a way

This month, Erik Darling (T | L | B) asks us to write about code that made us feel a way. Rule is, it can’t be your own code. That’s good, because that usually makes me a bit sad when I review it. The moment I write it, I think it’s brilliant though ;).

Most code I see has an effect on me, whether it’s positive or negative. I’ve seen some tools create the most horrible code (with vendor of that tool claiming it to be the best code ever) and I’ve seen tools create very nice code. Thing is, I can’t really say more about that because of NDA stuff.

What I can write about is the code that got me started. Let’s go back in time to 2009. I was working at a government agency and my amazing manager asked me to jump into the team that was developing the code for next years process. What we were doing was registering a lot of information that came from farmers. Every year, they’ve got to supply a lot of information about their farm (acres, animals, manure distribution and crops) and in return they get subsidised. For some it’s a few euro’s, others get serious amounts of money. But the input has to be checked. Part of this is manual labour (where I started in this agency) and part is automated. There are a number of stored procedures checking all the information against business rules and when the information is submitted correctly, it passes on to the next step, else farmers get a letter asking for clarification.

There are a number of procedures involved and I had already started exploring code. I bought myself a book on the SQL language and had a small database running at home to fool around with. Then came the question to jump onto the team and the first question was to read the code and provide some sort of documentation. This meant trying to read the code, finding out what it was doing (I knew what it functionally did, but technically it was a whole different ball-game), and writing it back into something regular humans might understand.
Yes I was thrown in at the deep end, but when the alternative is staring at some paper and checking if checkbox has or hasn’t been checked fully…

As it’s 15 years ago, I haven’t got the code anymore, but after my first enthusiasm I quickly saw that a lot of people had been working on the code, all using their own standards. All using their own aliasing. Or not. When I asked one of the senior developers to check where data went for a specific check, he started to check the steps. Seeing multiple aliases, and after eight or nine steps, he lost it. Went back, tried again and lost it again.

At that point, I learned that code could be very easy (the stuff I wrote then, being simple select statements) to very difficult (like those stored procedures). That was also the moment I realised I had a lot to learn. How that made me feel?

Challenged!

Thanks for reading!

Leave a comment