Quality in Development

Published by

on

Ah, the dreaded compilation error at runtime. There are more than a few variations of this issue across the varied domains of development. Whether you compile your code or simply execute queries in a database, you are for certain going to encounter errors in your career. Not only that, but sometimes the results range from incorrect, to confusing, to downright absurd. I’ll talk about a few things in this post to address the most common failure points.

The first type of issue arises from syntax errors. Oh, you thought grammar was only for your native language? Programming languages have their own syntax! Miss a semicolon in C++? Bad luck. Really think you’d prefer a different amount of indentation in Python? Oof. That’s not going to fly. Make sure you understand the language’s proper use of syntax as well as have a solid understanding of your development tool’s ability to assist you in debugging to catch these mistakes either before or after they happen. Even the most experienced developers make mistakes.

The second type of issue arises from semantic errors. Your grammar is right here, but something else isn’t. Everything compiles and/or runs, but the output is… well… wrong at the very least. “Unanticipated results” get a whole new meaning here. Did you code a game and mean for a sword critical hit to do an extra +4 damage on top of the regular range from 3 to 5? Oops, you divided by 4 instead, so those “critical hits” that should rain terror on your foes are pitifully laughable at best.

That former example is likely less egregious than assigning a number to a string variable, however. You are just asking for headaches in many of these types of situations, so do be careful how you use data types. Sometimes, a varchar (string) that accepts both alphabetic and numeric characters is nice and flexible. Unfortunately, it can cause problems downstream if you pass such a thing in for calculation purposes.

Ultimately, we all makes these mistakes. Don’t beat yourself up too much if you encounter them, and take breaks when needed in the debugging process. Remember, even though code can feel like it runs off magic, ultimately it is all based on a logical order of things and with dedicated investigation, you can figure out what is going on.

Good luck!

Photo by Tim Gouw on Pexels.com

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.