Warning! Tech-speak ahead.
A few days ago I posted about trying to get a MariaDB database connecting with some PHP code. In brief, for the uninitiated, MariaDB is a database program, popular with the web app crowd for its ease of use, and PHP is a programming language used to build webpages that actually do something rather than sit there and just look nice.
In my tiny bits of “spare time” I’m gearing up to work on a web app I started several years ago, but it fell by the wayside for a number of reasons. It is writing related, but not directly about it. More writing-adjacent. I can’t really talk about it right now but I find the project interesting and a bit of a challenge. As I go I find new approaches or more efficient ways to format the code to make it cleaner.
I’m big on clean, readable code. I’ve always taken to heart one of my programming mentors used to say –
“Always write your code like it is going to be maintained by an axe murderer who knows where you live.”
The longest part of any software project is maintaining the code once it is written. New functions get requested, programing languages get updated, your boss tries to rewrite your code while you’re away at a conference because he wants to make “a small change” to the way the program works and screws it all to Hell….
If you write clean, readable code, it makes it a lot easier to maintain. If you have to go back six months later to make a change, you want to know what you were thinking so you don’t have to spend a week trying to figure it out. That just frustrates everybody. I used to work with coders that would write the most cryptic, incomprehensible code because they thought it gave them “job security”. If they were the only ones who could navigate through their code, then they’d have to remain employed. Wrong! They’d end up getting fired and then some other poor coder would have to try to wade through their crappy code, make sense of it, and then make the “urgent change” the boss wants made. Ask me how I know.
I’m finding getting back into programming quite enjoyable. I’m a pretty rational kind of guy. I like structure and order and a general lack of chaos. You know when something is working in a program and when it isn’t. Most of the times when it isn’t working, you get an error message, which gives you some idea of what the problem is, or at least where the problem is, and you can fix it.
There are other errors in a program, design errors, but they can be more subtle and harder to find. The program may look like it runs, but somewhere in the lines of code, you had a flaw in your thinking, and the program doesn’t do what you thought it was doing. These types of errors might not show up until you’ve used the program for a while and notice something is off. Hopefully these problems are found relatively swiftly and fixed.
I have noticed that my mind wanders off-topic while I’m working on code. The Muse throws story ideas at me. When this happens I rely on the ideas running through the “survival of the fittest” gauntlet. If I can’t remember the idea later when I can write it down, it wasn’t a good enough idea to begin with.
Other times, if I need to look up syntax for a function, or how to write a complex query to get information out of the database I find that half an hour or more might have passed when looking for the answer. This stems from making the mistake of getting on the web to look something up, and going down various rabbit holes.
Sometimes I stop to check email, which is a rabbit hole all its own.
I figure if I could get my hands on some NZT (the brain-enhancing drug in the movie Limitless) I’d probably have this worked out inside of two weeks. As it is, it might take a little longer than that. But I’m enjoying the journey. And when it is done I’m hoping it will be a useful resource for folks.
Wish me luck, my Hordeling.
If you’d like to support my efforts, why not buy me a chocolate chip cookie through my Ko-Fi page? https://ko-fi.com/jhusum