How code should be written: Asking the right questions

Zandre Schalkwyk
How code should be written Asking the right questions

Photo by Markus Spiske on Unsplash

Lately I’ve been finding myself asking the same question over and over again.

How can I become a better programmer?

What makes someone a bad programmer or a good programmer? What’s the difference between a junior programmer and a senior programmer? Lastly what defines us as programmers?

Before I start with my monologue, here’s a little more information about myself. Because why would you care about my personal opinion, regarding a field you may have been working in for far longer than I’ve been alive. Now I can’t give you any concrete answers, but I can provide you with the reasons I am so passionate about what I’m going to say.

I’m a Programmer, my name is Zandré Schalkwyk and I’ve been running software companies for about six years now. I have a beautiful wife and 2 fur-babies. I live in South Africa and at the time of writing this I’m 24 years old (took me a while to remember my age). Notice how I emphasize that I’m a programmer before anything else.

I am a programmer and that is how I’ve been living my life. I try my best to work at least 18 hours a day, but the truth is I probably work around 16 hour days, 7 days a week. So lets calculate my “Years of experience”.

If programmer X works 9 hour days, 5 days a week for 10 years, we would end up with: 9 * 5 * 52 * 10 = 23 400 hours.

And then let’s say, I work 12 hours a day to account for times I was sick, dying, lazy or playing World of Warcraft. 12 * 7 * 52 * 6 = 26 208 hours. Does that make me a senior?

Does the fact that I have worked for a few big and successful companies, managing, (trying to) small and big teams, designed infrastructure and enterprise solutions make me good at my job?

I’ve also had the pleasure of running my companies from home. I had to admit that I was lacking in areas and ask for assistance. I had to hire and let go of people along the way. Does that make me a successful business owner?

Then of course my pride and joy…

I was able to convince my wife to marry me, get a house together and we are pretty much living happily ever after. Does that make me a successful person?


I’m just a regular old programmer trying to compile all my code.

The methods I’ve been using, and the ones that I haven’t been using make all the difference.

I talk, a lot, you can ask anyone that knows or worked with me.

I really like asking questions such as; what languages do you like and why, how do you do this and how do you do that? Most of the time the why is more important than anything else. Why do you code in C/C++ when Rust has more benefits while maintaining similar speeds? Why use a Mac instead of a Windows or Linux machine?

I’ve gotten hundreds if not thousands of different answers to the questions above. And I’ll always keep asking.

I get asked similar questions.

Now let’s get into the actual content of this article.

Photo by Caleb Woods on Unsplash

Sorry for the long wait…

We as programmers of any caliber ask the wrong questions. Instead of caring about all the things mentioned above, we should be asking questions like; how do you reduce the amount of lines of code you need to write? How can we reduce the amount of stuff QA or clients yell at us about? How do you remain focused to avoid crunch-time and late deliveries?

Instead of spending time learning new languages or frameworks, why don’t we sit down and clean up our code? Why learn to debug, instead of learning how to reduce bugs? Why do we panic and rush to meet deadlines, instead of learning how to properly estimate our deliveries? Why do we use elastic cloud computing when we can write better, hardware friendly code that may in fact cost our clients thousands of Rands (or Dollars) less.

As I should have been doing from the start of my career.

Find the right questions before writing code (or articles).

I think “Uncle” Bob Martin sums up a few things nicely.

We don’t care about our jobs, or how we do our jobs.

Doctors and lawyers have dire consequences when failing to follow industry standards.

If you go into court, or in for an operation a small error (what we would call a bug) could mean the end of your life, or cost the individual their career.

Why the {X} don’t we treat our code, our jobs in the same way. It’s really easy to say; “Oh that’s just a bug”. We should feel ashamed of everything we let slip through the cracks. We should feel bad about being blocked and just sitting around. We should feel bad about missing deadlines.

Right now we live in bliss, here everything we do is just pixels on a screen and doesn’t affect the world outside of our computers.

That’s a lie we tell ourselves everyday to justify our mistakes.

It needs to end here!

Test your code, find and squash the bugs before QA or clients see them.

Start your job early and finish late. You are a professional just like all the others.

Be passionate and take proper ownership of your job or go home.

Bugs should be rare and minor. Care about how you look and how you talk to clients. Tests should be well written and extensive. Get into work on time and know you’ll always be on standby.

Because that’s what it means to really call yourself a programmer.

A professional programmer.

Thanks for reading!

One of “Uncle” Bob Martin’s amazing video:

Source link