DEV Community

Cover image for Tip for beginners: There's no such thing as "weird" in programming
Owen Conti ๐Ÿ‡จ๐Ÿ‡ฆ
Owen Conti ๐Ÿ‡จ๐Ÿ‡ฆ

Posted on • Originally published at owenconti.com

Tip for beginners: There's no such thing as "weird" in programming

Note: This is a crosspost from my blog. Find the original article here: https://owenconti.com/thoughts/no-such-thing-as-weird-in-programming/

After mentoring junior developers for over 4 years, and participating in online chat groups related to programming, the first piece of advice Iโ€™d give to new programmers is:

There is no such thing as "weird" or "coincidence" in programming.

That is, everything has an explanation. Whether or not you know (or understand) the explanation is what makes a problem feel "weird".

Computers are machines that are programmed to do specific actions when specific events occur. Letโ€™s take a look at an example where a (now common) problem seems to be a weird one, but in reality has a simple explanation:

Physical example

A couple years ago, Apple released a new keyboard for its MacBook and MacBook Pro models. This new keyboard has a mechanism called the "butterfly mechanism" as opposed to the previous "scissors mechanism". The problem with these keyboards is that eventually keys will start double or even triple pressing when you type them. However, the problem randomly occurs and usually cannot be reproduced on demand.

This is the type of problem where you might think thereโ€™s some crazy software bug that "randomly" causes keys to be duplicated. However, in reality the explanation is simple: The new butterfly mechanism allows dust and small particles to become stuck under the key. Hence, when a key is pressed, the stuck particle may cause the key to stick or even be triggered again, causing the duplicate key press.

Software example

Even though the example I gave above is due to a physical defect, the same concept applies to software problems.

Unless youโ€™re using bleeding edge technology that is unstable or doesnโ€™t have comprehensive testing, the bugs you run into probably have a reasonable explanation, you just donโ€™t know it yet.

One of the most common areas this type of problem could occur for new web developers is with CSS. I would define CSS as quirky and fragile, meaning very tiny changes can make a very big impact on the outcome of the product.

With CSS, it's very easy to hack and slash your way through problems to get something to "just work". Meanwhile, you don't actually know how its working behind the scenes.

Why is this a problem?

When you move on from a problem without understanding the cause, you don't learn anything. When you don't learn anything, you don't grow. When you don't grow, you stay stagnant. You get the idea ๐Ÿ™‚

Note: I understand that not everyone has the luxury to spend the time required to fully understand a bug. If you can, set a reminder to come back in the future to revisit the problem.

Let's not forget, as programmers/web developers/whatever you want to be called, we're hired to solve problems. In order to solve a problem, you need to understand the problem. That's problem solving at its core.

The more you know in your area of expertise, the better you'll be at it.

In closing

I see this problem most commonly with junior developers, however it happens to everyone. Senior developers are not immune to it, but I believe part of progressing from a junior developer to becoming a senior developer is learning how to understand both problems and their solutions.

Top comments (3)

Collapse
 
davestewart profile image
Dave Stewart

100%! I tell juniors to take responsibility by saying "I don't understand" not "it's weird". Saying it's"weird" encourages them to write hacky code in response to a problem that exists only because they don't understand it yet.

Collapse
 
mccurcio profile image
Matt Curcio • Edited

Coming from other parts of science, there were times when I(we) would come across a "weird" way of attacking a problem or better yet an "odd" explanation behind a case. In some cases it would be a new concept that we were tackling. (Science does have odd new concepts.) At those times we would call it "counter-intuitive". I don't think it's necessarily wrong to use "weird" but understanding that it may take a little bit to understand was understood. ;)
Patience Grasshopper

Some comments may only be visible to logged-in visitors. Sign in to view all comments.