DEV Community

Cover image for How To Think Like a Programmer?
Mr. Unity Buddy
Mr. Unity Buddy

Posted on

How To Think Like a Programmer?

Hello, buddies! Lemme ask you a common question,

Do programmers think differently?

It's true; real programmers think differently than everyone else.

Everyone’s programmer perspective is different; means, each programmer thinks in a different way and learns how to approach and break down problems in an unique way. Through practice, you'll develop your programming perspective, and it'll get easier to communicate with machines to solve increasingly complex problems. But the question remains, How to think like a real programmer? Let's see!

Break down the problem into smaller problems.

image.png
How do you put an elephant into the fridge?

Here’s what most people would answer:

  1. Open the fridge
  2. Put the elephant in
  3. Close the fridge

Problem solved!

image.png
Poor elephant :(

This answer is the best example of why you get stuck when you face a blank JavaScript file. You skip steps.

If you think logically about the question, you’ll see a few glaring problems that remain unanswered:

  1. What fridge are we talking about?
  2. What kind of elephant are we talking about?
  3. If the elephant is too huge to fit into the fridge, what do you do?
  4. Where do you find the elephant in the first place?
  5. How do you transport the elephant to your fridge?

When you code, you need to answer every small question you can think of. That’s why the first step is to break your problem into smaller pieces.

If you need a real example for this, write a comment below 👇🏻

Build Good Habits

image.png
A developer’s environment can be, be it mildly, hectic. Requests and requirements change with little notice, and the pace needed to meet deadlines can accelerate quickly. That’s why a developer needs to develop strong habits with what they can control, whether it’s managing work/life balance, templatizing repetitive codes, or even finding the ideal height on your chair. Habits make a reliable backbone that’s invaluable in frenzied situations.

Practice, don’t memorize

image.png
Memorizing code is tough, and you don’t need to go down that road to think like a programmer. Instead, focus on the fundamentals. Learn the principles and ideas behind programming, and you’ll get much further than trying to remember everything.

Every time you solve a simple problem using programming, you’ll develop your fundamentals even further, making it easier as you progress. Practice is key to your programming perspective becoming second nature.

Talk through the problem aloud

image.png
First, you can talk through the problem by calling up a friend or family member and explaining to them what you’re trying to tackle. By having a conversation with someone, you’ll be able to determine how you can communicate with them to clearly explain the problem and your solution.

Don’t have anyone to talk to right now? No problem! Just try speaking through the problem out loud. Explain your approach and understanding to your pets or even a stuffed animal. It’s speaking aloud that is the key.

If you're explaining to a human, please be careful! They may get mad from your programming terms 😤

Shortcuts can be dangerous

image.png
Taking shortcuts while you’re learning to program can be more hurtful than helpful. Try to think of the learning process like running tennis drills. You could take steroids to get stronger and become a better player, but that’s likely to hurt you in the long run.

Rather than searching for an answer right away when you encounter a problem, try to solve it yourself first. When you rely on other people’s coding solutions, you don’t get to develop that programming muscle yourself.

Focus on the basics, put in the practice, and run your drills. The tried and true training methods are that for a reason; they work! We know that it can be frustrating when it takes time to learn to program, but that’s all part of the process of forming your own programming perspective.

(Also keep remember that you must ask questions and seek help if needed.)

Get familiar with reading documentation and applying it to your code 📃

image.png
Documentation for programming is just like a recipe for cooking. It lays out how the code is intended to work and is an excellent resource to help you understand programming better. Learning to read documentation will also steer you away from looking for a shortcut or an easy solution to your problems or bugs.

Stay Positive ✌️

image.png
If you’ve ever viewed the source code of a major entity’s website, you’ve seen just how sprawling and indecipherable it is to the naked eye. Yet the people responsible for generating that mass of code aren’t super-machines that appeared on Earth after a solar eclipse. They’re suspiciously similar to you and me. Professional developers (even the surly ones) have a positive approach to their work. They’ve embraced challenges in their own way and see them as a normal part of a healthy human life ✌️

Always try to keep a smile just like Laughing Dev!

So, buddies, that's it! Hope you learned something and Happy Coding!

Originally published on Hashnode


References

Oldest comments (1)

Collapse
 
coderamrin profile image
Amrin

great article Mr. Unity. thanks for sharing :)