DEV Community

Cover image for How you shouldn't use StackOverflow ?
Saeed Ahmad
Saeed Ahmad

Posted on

How you shouldn't use StackOverflow ?

StackOverflow has been favourite destination of developers when they are stuck somewhere. It helps us a lot by giving us clues to problems we as developers are stuck everyday.

It is quite helpful for the new people in coding who if cannot find best solution to problem, the StackOverflow helps them to find the solutions proposed by experienced and more intelligent developers throughout the world.

It's all good till now.

But you may have also heard of people being fired from their jobs because of copy pasting code from SO.

As we know, every action of a person has both it's downsides and advantages. Getting help from SO is not bad at all, but it has some disadvantages too.

Today, we are going to discuss those things in detail in order to avoid common mistakes which newbie developers make while taking help from StackOverflow.

Mistakes new Developers make :

1. Copying code :

Most new developers when they get a problem, directly google it. They land on some SO answer by people. They copy the code from there and paste it. Problem solved!

But did you guess that developer missed so many things by this one copy-paste action ?

That's the first and foremost disadvantage of using SO. For solving a problem, there's a complete thought process. By doing this we are skipping this process, which is fine for quickly solving the problem for that time. Your team would be happier. May be you lead will congratulate you for solving the problem in a record time.

But you will suffer in the long run. When you solve a problem with a complete thought process, you develop a sense of problem solving. Problems in the world are different. Their nature is not same. But you know there's an organised way of solving every problem. If you learn that pattern, you are more efficient in solving problems which aren't known to you before.

2. Following what others say :

Human beings are creative creatures who use power of their intelligence to innovate new ways of solving problems. We as developers are also intelligent people who use the power of creativity to solve problems in innovative ways through coding.

Every developer is creative. Everyone has their own way of solving problems. When we solve problems our own way, new and innovative ways of solving problems emerge from that. However, when we follow others blindly then we are also burying our own creativity by following others.

3. Overlooking the concepts :

Every field has some of it's core concepts which remain same. There are abstractions of top of these things but core remains same. So, the person who's focusing on core always has a better understanding as compared to those who focus fully on abstractions.

Similarly, if you see any languages, all have data-types, loops, file system handling and other I/O operations support. So, If you learn these concepts you are more comfortable in picking up any language. After that, you can extend your same set of concepts to other languages as well.

By using SO, most developers neglect the conceptual thing behind any problem. They seem to overlook the main set of basic concepts which is working behind the scenes. That's thing which makes them depend on getting help from SO, even when they have solved the problem before.

4. Not Discussing the problems :

When you are stuck in a problem, then most probably you discuss it with people senior and more experienced than you. Developers have a very known picture of them in the society. What it is? Everyone knows. They prefer to work in isolation. They aren't good a communicating with people. That's where business people step in.

But. Discussion with senior people when you are struggling to solve problems helps you a lot. It forces you to learn new ways to deal with problems. It teaches you how to think proactively and deduce new ways of working on ideas when you are stuck. It makes you learn the art of revisiting your strategy. When you discuss it with your lead, it helps you improve your communication skills. It improves your negotiation skills. It helps you a lot. Believe me!

Instead of that, if you by-pass this process by merely copy-pasting the code from SO, you may have noticed what you are gonna lose.

How to use SO ?

Am I against the use of StackOverflow ?

Not. Certainly not.

I am not against using StackOverflow but I think any developer specially newbies should understand what they copied. A good practice is not to copy but instead first understand that code. Then, if you have understood that replicate it in your own way in your code.

Sometimes, you don't understand the solution completely. At that time, don't panic. Copy the code line by line. Like try to replicate first line which you understood. Break it into small parts. Run that code. Understand that part then move on to the next. That way you can understand the big problem.

Other than that, There are time when you need a solution immediately. For instance, you have a deadline. At that time, it's fine to copy and paste. But later on when you are free revisit the concepts. Revisit the solution and understand that. It will help you deal with other problems in future.

💡Do you have any suggestions for new Developers?

👇 Share in the comments below

Top comments (12)

roshnet profile image
Roshan Sharma

Great post Saeed!

I would like to add that every SO answer that solves the problem, does it under a number of constraints.
That's not always the case, but people should also bear in mind that one solution doesn't fit all scenarios.

The answer might work best for the one who originally asked the question, but that might not be something your application needs.

Investing knowledge gained from multiple resources (blog posts, tutorials etc) and then coming up with a tailored solution is IMO the best way to go about using StackOverflow.

mrsaeeddev profile image
Saeed Ahmad

Thanks for appreciation.

Yeah exactly that's the message which I am trying to convey through this post.

sebbdk profile image
Sebastian Vargr • Edited

I feel like telling people to not use copy paste is equivalent of saying "dont use package managers, because real developers make stuff from scratch".

Anyhow's, in terms of learning these tips seem solid! 👍

"But you may have also heard of people being fired from their jobs because of copy pasting code from SO."

Wow, that sounds like one of the more stupid reasons i've heard people get fired for..
There has' to be more context to this than SO. :D

mrsaeeddev profile image
Saeed Ahmad

Haha. Yeah it's one of the stupid reasons but it has happened, so, we can only take precautionary measure. No, I think building any thing from scratch is not the appropriate advice in most cases. Instead of that, what's going on in that code should be understood. Merely copy-pasting or downloading a package and not understanding the logic behind it should be discouraged.

mrsaeeddev profile image
Saeed Ahmad

Read this :

Yeah I have presented the same point.

grsahil20 profile image

Very well written.

mrsaeeddev profile image
Saeed Ahmad

Thanks for appreciation.

jsdevelopermano profile image

Great article!

My Opinion, using SO can get a different way of solutions. But I won't recommend the copy-paste code.

mrsaeeddev profile image
Saeed Ahmad

Thanks, Manoj!

mrsaeeddev profile image
Saeed Ahmad

Yeah exactly. Thanks for your appreciation.