An Illusion of mastery

Published Apr 28, 2017Last updated May 08, 2017
An Illusion of mastery

Most people a few months after taking up programming will reach a certain point where they feel they are the best at what they do. In reality they know but a small fraction of the vast world that is programming. Which is why this post is targeted to the beginners. "But wait how do I know I'm not beginner ?" I've a simple Python problem below. Read on.

Who wrote the better version?

# Store a list of all whole numbers upto 1000 divisble by 12

# Programmer 1
numbers = list(range(1000))[::12]

# Programmer 2
numbers = filter(lambda x: not(x % 12), range(1000))

# Programmer 3
numbers = []
for num in range(1000):
    if num % 12 == 0:
        numbers.append(num)

If you are a beginner in Python chances are you've never come accross lambdas and the filter function and that's alright. The purpose of this post is not to discourage you. It is to enlighten you of the fact that being modest with yourself is the only way. Not only is this attitude helpful in the industry but it will also push you to dig deeper, to find asnwers.

If you think you know which version is the best. Leave a comment below and you'll be surprised by how many people disagree with you. Whatever the option you pick there is no right answer. A mark of a good programmer is knowing what you don't know. So get your head out of the clouds and start poking around on google or better yet find a mentor who can guide you. Hopefully you'll determine what you know is not enough.

Discover and read more posts from Vivek Joshy
get started
Enjoy this post?

Leave a like and comment for Vivek

10
16
16Replies
Jim Tully
2 months ago

I am a beginner, coding only since 2009, and really only regularly in a job since 2012. I rebooted my career at that time, and I genuinely enjoy doing what we do. It is reassuring to know that it doesn’t always have to be fancy to be right. In fact, I thought it was NOT 3 simply for the fact that it was closest to what I probably would have written. I know overconfidence is not my issue, perhaps a lack of confidence that I know enough, and know what direction I need to go next, to improve as a coder and advance in my career. However, I do see the “Illusion of mastery” in many people, mostly on forums and groups who have a very specific way of handling any situation. My way is best described as somewhere between, ‘I know this works’ and ‘I taped this together from examples from the internet’ then I hit F5 and try and play a little Jenga with the code until it works as I intended. To my own credit, I usually get things to work, but I feel more like I am hacking my way through it rather than explicitly knowing the solutions. Not sure when that feeling magically goes away, but I don’t imagine it will be all that soon. ;) Anyway, really enjoyed the article and the comments.

andy jewell
2 months ago

There’s another option (which you might have avoided for your own reasons):

numbers = list( range(0,1000,12) )

This is more efficient, because it doesn’t generate all the numbers that aren’t multiples of 12.

Vivek Joshy
2 months ago

Yeah, it didn’t fit the example because not all iterable functions have that parameter. The first example although unorthodox is meant show that it doesn’t work for other ranges (eg: list(range(1, 1000))[::12]).

Let me quote the zen of python by Tim Peters,
“There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.”
.

Chris Muenke
2 months ago

I would not say that your example is a good one ;). I started programming 24 years ago in first grade at the age of 6 and been doing it daily ever since. I studied math and computer science (yes, both) and did myriads of projects across all areas of software engineering and like with any other discipline, the longer I do it, the more I understand how little I know and how much I have to learn.

I have successfully interviewed with companies like Facebook and Amazon and I am considering myself at the BEGINNING of my career as engineer.

I am always amazed by these code camps and people thinking they know programming after spending a few months in there… It is nice that so many people are doing it, but please guys, realize that software development is as difficult as any other science and the same way you may never find a unified theory of quantum gravitation, you may never be a good software developer.

My message: You have lost your edge the moment you think you are done learning and the moment you think you are good.

I think a good analogy is that of the dentist. My father always says you don’t need to study to do what he does and you can learn all of it in 6 months. It is probably similar with any other area, like heart surgeon… Yet, would you rather hire a cheap heart surgeon from a heart surgeon camp or does it indeed make sense to hire someone who did the 10+ years broader education? And with software engineering it’s even worse, because you don’t have standard procedures to follow.

Vivek Joshy
2 months ago

Nice analogy. I think we are agreeing here. A lot of new developers write a bit of code and feel like they are on top of the world. They stop learning altogether. The aim of this article however was also to show beginners there are pretty looking ways of doing things and readable ways of doing things. I’m hoping that whoever reads this will feel have a self realization like I once did.

Show more replies

Get curated posts in your inbox

Read more posts to become a better developer