Geeks logo

Coding for Clarity

by Adrian Dickreiter 10 months ago in art
Report Story

A Non-Programmers Guide to Finding Zen in the Art of Code

There's a joke I was told when I first started taking computer courses in college. One of my professor's told me, “Those who can't” I was a networking major, so the joke was on me.

Mind you, I didn’t mind the joke. It was a good one. In my estimation, only about 1% of those who go into Network Administration can program with a semblance of quality. Network Administrators often have tools, graphical interfaces, websites or command line consoles to lean on. They don’t need to code, because someone else already did this for them. Someone else wrote the code that became those tools, that graphical interface, the website or even the command line that Network Administrators have come to know and love.

But I wasn’t among that 99% of Network Administrators. I always could program. Okay, maybe not always, but I was programming from the age of 14. My brother had taken a course in high school where he learned Q-Basic and he went on teach it to me. I learned on the computers at our local library. Primitive by today’s standards, these were all command line, text based. Like many programmers, I marveled at the bit of code required to make the computer say, “Hello World”.

But that was a long time ago. I’m in my 40’s now and those early days of programming seem a long way off. Along the way, I had taught myself more Q-Basic, which lent itself to Quick Basic and eventually I learned Visual Basic, the graphical version of Basic that still, by some miracle still exists today. When I was working at a hospital and we had a terrible transcription / dictation system that would frequently crash at inopportune times, I found AutoIt and wrote automation scripts to “watch” the server screens for errors and when one was encountered, it would automatically reboot the server, relaunch the application, log into the application, navigate the menus and get the server working again all with only about 15 minutes of down time instead of hours or days.

While this was a highly practical application of my hidden and somewhat latent programming skills, the thrill of designing these automation scripts was soon lost. I would find myself, after several years, needing to scratch the itch of creativity again. It was then that I found myself doing Excel VBA to make my job easier. I was working on large spreadsheets at work, that were inevitably poorly formatted at best. To easily share these with my supervisor and colleagues, I would often have to spend significant time formatting these spreadsheets so they looked good when printed. With time, I realized that I could accomplish the same thing, consistently by using Excel VBA. Suddenly I found that creative outlet that I needed to maintain my sanity.

While programming for most can be a frustrating thing, especially if you aren’t a programmer, for me programming was a beautiful thing. I took great pride in formatting my code just so. It had to be highly readable so I could go back to it later and make changes. Obviously, it had to work correctly, every time. And to this day when I suddenly find myself needing to take something repetitive and break it down so that the work gets done faster than I could otherwise do it, with the same degree of accuracy that I would normally give to work, I often allow that tickle worthy, creative part of my brain to engage. My work hasn’t always been fulfilling. I do a lot of paperwork that often doesn’t require any creativity whatsoever. So, for me, this creative outlet, often maddening to most, is a form of relaxation. Often, I plan out my work, step by step, long before I write out a single line of code. But once I’ve done so, I often find myself writing several lines of code, sometimes even huge portions of code, before I test it. Seldom does it work correctly the first shot, but the payoff of my hard work, my Zen-like mental state of mind, is seeing the “macro” do its job correctly in the end.

Artists often find themselves creating a masterpiece through time and effort. Coders create a similar masterpiece. While it isn’t often thought of being particularly beautiful by most, there are elements of beauty to be admired, if one knows what they’re looking at and what they’re looking for. In programming you format everything a specific way, or at least you should. Good formatting means easy readability. It’s analogous to walking up to a well-organized toolbox versus one where all the tools are simply thrown together. If it’s well organized, you can easily find what you’re looking for, just as a well formatted program is easy to follow. Formatting takes the form of consistent spacing that groups together code that are closely related. It also means spacing this out effectively from other pieces of code that aren’t related to a particular task. Then there are notes. Notes. And more notes. Any good programmer will tell you that notes speed readability and understandability of what you wrote, whether it be something you wrote yesterday or code you wrote a year ago. If you have clear notes, it’s easier to pick up where you left off. It’s almost like having a map of your city. You know that it’s your city and that means that you often have a general idea how to get wherever you’re going, but if you don’t go somewhere very often, you may struggle to get there a year or two later. You may take few wrong turns before you get where you’re going. If you just looked at that map before you left the house (of course today everyone just uses a GPS and calls it a day) you probably could have gotten there a lot faster.

Good formatting and clean notes are important to good code, but the Zen of programming is really in the actionable code. It’s the code that actually does something that’s important. Newbies and weak coders will often look for code that fulfills their need, copying it off the Internet and pasting it into their code, hoping it will work. The best programmers can keep a logical train of through across dozens or hundreds of lines of code, remembering variables they’re actively working with, understanding how they’ve manipulating these over time and while they could test every line of code every step of the way, they don’t need to do so. Instead, they write a significant portion of code and then save their work. Then the true test comes. They run the code. The beauty is running this code and having it work the way they know it will. It’s a beautiful, calming, sometimes maddening thing that we do. It frustrates us. It challenges us. It forces us to think several steps ahead, like playing a game of chess against yourself. The satisfaction of well written code, executing exactly as you expect it to. Every. Single. Time. It’s an amazing thing.


About the author

Adrian Dickreiter

Full-time IT worker, part-time educator and part-time aspiring writer. I love a good story...who doesn't? I hope to write a book one day...maybe several. I want to inspire others to do more, try harder and be a better version of themself.

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights


There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2022 Creatd, Inc. All Rights Reserved.