I was asked an interesting question last week. Do some programmers deliberately make their code obscure to preserve their job security?
It’s a rooky mistake
I’ve met programmers who try to do exactly that. They think that, if they are the only people who can maintain their code, they will have job security. In my experience, these tend to be junior programmers.
I believe senior programmers know better:
-
They know that they might be the person who has to maintain the code. Unmaintainable code is exactly that. A year after you’ve written it, you may find it just as difficult to read as the person who didn’t write it.
-
They know that the powers in charge make retrenchment decisions based on cost, not skill. Nothing in life guarantees job security.
This was the first part of my answer.
Code is for coders
The person asked the question during the Introduction to Python Programming course. So he is new to development. And that leads to the second part of my answer.
Experienced programmers assume that their code will be maintained by people with similar levels of experience. They do not write the code for novices. So, to novices, it will look obscure.
This is how it should be. Systems are the life blood of most companies. They need to be treated with respect by knowledgeable people. You don’t make health or financial decisions based on your friend’s
neighbour’s cousin’s wife’s opinion. (Well, I hope you don’t.) In the same way, you shouldn’t entrust your systems to people without the right skills.
An aside about learning Python
There’s a belief out there that Python is easier to learn than other programming languages. I loved this comment by someone on Quora:
“It’s just one of these idiotic things that people repeat because they heard other people say it. Python is just as easy or difficult to learn as any other programming language, give or take. All the basic syntax and structures in Python are about the same as in any other imperative language … knowing one language or 20 has never been the hard part of programming.”
Nobody learns to program in 24 hours, or 5 days or whatever the popular book title claims. Learning language syntax is not the same as developing the thinking skills you need for programming. I am glad when companies are prepared to invest in upskilling people. But it’s important to have realistic expectations.
Unrelated, but entertaining
If you’ve ever tried using a voice assistant like Alexa or Siri, you might enjoy this video. It also reminds me of some call center experiences.
As always, I’d love to hear your comments.