Skip to content

Do not be THAT type of programmer

When you work in a team or you have to teach or instruct your coworkers and employees, you probably have to decide pretty early how you are going to deal with them in order to accomplish the goal.

Sometimes they are not as experienced as you, sometimes they just were taught a different way. In any case, you will probably have to deal with other people’s code very often.

This will not be a guide on how to behave. Just a little reminder. Take a look at this comic from XKCD.

https://sslimgs.xkcd.com/comics/code_quality.png

DON’T BE THAT PERSON!

Yeah, writing in uppercase characters is considered rude because it means I am yelling. But in this case it is totally appropriate. See how the more experienced programmer is not being very helpful. What is the less experienced programmer going to learn from those useless remarks? Is that person ever going to change his coding style?

Probably yes. But he will be ashamed to ever show his code to someone again. Code shaming is a thing, unfortunately!

Whenever you ever catch yourself thinking “This is an awful piece of code he/she wrote there!”, think again. What was your code like when you started learning and trying new things?

if (checkBox1.isChecked() == true)
return true;
if (checkBox1.isChecked() == false)
return false;

This is an example of my excellent coding skills when I started learning Java. This horribly redundant code can be reduced to this equivalent statement:

return checkBox1.isChecked();

Whenever I think about it, I like to facepalm myself so hard it hurts for hours. But then I think “Don’t we all produce this kind of code in some time in our programmer’s life?”.

Today I am a professional check box handling coder. I learned that trick from a student who had a few years more experience than me at the time.

If it had not been for the helpful advice, I would still use the first method.

Published inPersonal

Be First to Comment

Leave a Reply

Your email address will not be published.