Some people have more affinity than others when it comes to critical thinking, but don’t let that discourage you to learn it. Even for those that logical thinking comes more natural you need to keep improving. It’s a continuous journey, you get better over time, and you won’t become good at it overnight. Persistence is key, it’s basically brain training, and it’s good to keep the brain sharp.
You don’t need a strong logical mind-set when you start coding, but as you gain more experience and get better at it, it will help you to create better code and solve complex problems more elegantly.
As you might be coding on a day to day basis, your logical thinking will improve also, but giving it an extra push won’t hurt and is perfect for your personal development as a coder.
So, what are the tricks?
Some people are more visual than others, but I believe that the majority of developers benefit from visualising. There is various ways to do this, like make an activity diagram, sequence diagram, or any other type of diagram depending on what you are doing. There are many different diagram types out there, but especially for your own reasoning and understanding, don’t worry about the strict notation that comes with it.
It’s worth getting familiar code challenges, also known as “code katas”. They are great for brain exercising your logical mind-set as they focus on a specific challenge that you should solve. There are several (social) platforms where you can find and create code challenges; some come with ranking and all that stuff. Often you can also review other people’s submissions, which is also great, as reading other’s code will help you improve you logical mind-set.
Learn Algorithms and Data Structures
Rather than creating the solution to a problem, it helps to read and understand existing (battle) proven solutions where the pros and cons are widely documented. When you search on the web or read books about algorithms and data structures, you will benefit from learning existing solutions and their complementary data structures. Like with code challenges, reading and understanding other people’s solutions will challenge you and advance your logical thinking.
This falls under the same category as the “visualise” tip. Clean Code itself does not necessarily translate in better logical thinking, but it does assist you on getting there. The idea here is, if you learn on making your code more elegant and clean to read, you will be able to understand the logic better. The easier your logic is to understand, the easier it is to find flaws in your logic or room for improvement.
At Cheery Robot, we prepare the kids and teens of today for the fast changing world of tomorrow!
Cheery Robot teaches kids & teens computer science, coding, robotics and other valuable skills while having loads of fun in a collaborative and immersive way.