DEV Community

Cover image for 7 Ways To Improve Your Logic In Programming
Mr. Unity Buddy
Mr. Unity Buddy

Posted on • Originally published at mr-unity-buddy.hashnode.dev

7 Ways To Improve Your Logic In Programming

Hello, buddies! Programming in itself is a very beautiful art. Sometimes we may face some problems while trying to program, but we can definitely overcome them. Most of the programmers/beginner programmers are having problems with the 'Programming Logic' part. They know the syntax, modules to use and everything but can't figure out the problem in the right way. So, in this article, we will see 7 techniques to improve your logic; or we can say "Problem Solving".

1. Think to solve

image.png
If you think that you can’t do it. Then no one else can help you to develop your logic. Programming is all about finding the right solution to the problem. With the help of programming, we split the big problems into smaller ones; then we try to solve the small parts. Apart from writing the whole programming on paper or word document.

All you need to do is write the pseudo-codes of the programs to solve the problem. If you are a beginner to the programming language. Then it would help if you tried to start from solving the easy problems, then the intermediate ones and then the complex ones.

But never stop yourself to solve the issues. The more complex issues you try to solve, the more you improve your logical thinking in programming. It will help you do get a solid answer on how to improve logical thinking in programming.

2. Practice

image.png
Practice is a crucial part of our life. If we want to have a better command over anything, then we need to practice the same thing again and again. And at some point, we get the perfection on something. The same rule applies to program logic.

We know that programming is not that easy; it requires passion and determination. So why do you need to practice to improve your logic in programming? The most straightforward answer to this question is to try to practice some prewritten algorithms. An algorithm is the set of operations that are used to solve a predefined problem.

There are millions of algorithms in the world to solve easy to complex problems. It would be best if you practiced some of the most used algorithms to improve your programming logic. In this way, you get an idea of how to improve logical thinking in coding

3. Pen and Paper Approach

image.png
After seeing any problem, we generally start coding the same on our IDE. So, when we are asked to write code on paper in interviews, we fail to do so. Always try to write the pseudo code or algorithm of the code before implementing them. It will help you in writing the code and next time whenever you approach a similar problem you will be able to recollect more easily. It will also help you in getting syntactically strong.

4. Puzzle Solving

image.png
In many coding competitions, problems are not directly asked based on a concept. Instead, it generally involves a story woven around it, and we have to figure out the logic for solving the program. In such cases, sometimes we are unable to solve the problem. Try solving puzzles such as Sudoku to develop your logic and thinking ability because programming is nothing but solving complex problems with the help of good logic.

5. Find a Programmer’s Community

image.png

Sometimes we get bored while solving the problems by ourselves with no one to teach or guide us. In such cases, you can always try discussing solutions or complex questions with fellow programmers and friends. This will always help you in finding new logic for the same problem and will help you in optimizing your code. This will also improve your confidence and communication skills!!

6. Play Games

image.png
Some of the games require plenty of logic. You can play games, Chess, and other similar logical games to improve your logic. Most of the pc games help you to sharpen your logical thinking. In my opinion, you should play games for at least 1 hour every day. It will help you to do your brain exercise. The games are helping the programmer to develop their logical thinking for programming.

If you want to learn CSS by playing some games,@Suprabha Supi has a list of games!

7. Read Books and solve Examples

image.png
Having a programming book is also beneficial for the students. You can find plenty of solved examples in the programming books that can help you improve your logic in programming.

The basics of programming can never be changed, and you can check your programming logic with the help of the programming books. It would help if you also tried to solve all the examples with your efforts and logic. In this way, you can improve your logic in programming.

So, buddies, that's all for now. See you later and Happy Coding! ✌


References

Top comments (10)

Collapse
 
vadimkolobanov profile image
Vadim Kolobanov

Using my own example, I will say that I began to write more beautiful and logical code when I started studying the code of professional projects. I just opened the github and watched the pros write. I have found a lot of elegant solutions that make the code logical and professional. so as one of the ways, I will also tell you

Collapse
 
juanfrank77 profile image
Juan F Gonzalez

It's funny that I developed these skills in my backend days and then I moved on to frontend and now I'm more into the UX side of things. Even though I don't need much complex logic anymore, the "problem solving" aspect is useful regardless of the field.

Collapse
 
hassantayyab profile image
hassantayyab

Hi Juan :)

Can you please share how you transitioned from frontend development to UX since I am also very interested to do so?

Collapse
 
juanfrank77 profile image
Juan F Gonzalez

Hey mate,

Well, in my case I eventually realized that I'm more of the "creative" side after working in several projects. What I did was to start getting involved more into the "user side" of the project and talk with the ones responsible for that.

I also started learning more and more about that side of development and then share some of those lessons in tech talks within the company.

In the company I'm currently in, I joined a "study group" about CSS and user interfaces and started sharing stuff there.

I also talked with one of the leads there to see if I could move to a more "user facing" part of development and now I'm in a project where I'm not a visual designer per se but more like a developer focused on user experience and accessibility.

Your mileage may vary but I hope this has given you some ideas ;)

Thread Thread
 
haisan profile image
_samuca_

I also like this UX side of the frontend a lot more. But I have a hard time finding a job where I can focus on that. I feel that companies don't value it as much.

Collapse
 
thenickest profile image
TheNickest • Edited

Definitely a nice read! To some aspects I can already relate while others (gaming) I cannot yet. Will check out the list!
I was once told I won’t make it in programming and that an IT background ads to problem solving.
From my experience it needs creativity to solve problems. And looking at problems only through a pair of IT goggles might even blur the view.
Happy coding!

Collapse
 
mohamed143 profile image
Mohamed143

Thank you bro

Collapse
 
petrof21 profile image
Bojan Petrović

Awesome and inspiring. Thanks!

Collapse
 
tisoportes profile image
tisoportes

In other words keep learning trying to do the best always.

Collapse
 
Sloan, the sloth mascot
Comment deleted