DEV Community

Tomer Raitz
Tomer Raitz

Posted on

The Right Mindset To Solve Complex Problems

Alt Text
Hi all, I know that all of my articles are very technical. This time I will talk about something a little bit different, more abstract - the mindset of a developer when assigned to a new task.

Why do we need to notice our mindset when assigned a new task?

Lately, I have tried to be more self-aware of myself and my surrounding. I notice something significant when I'm dealing with a complex coding problem it always starts with "oh shit, it's too hard," and if this feeling stays with me, it impacts the quality and the amount of time that I spend on this task. So, I believe to be a better developer We need to notice our attitude to the task we are currently working on. I think the right mindset is to be fully confident that you can succeed in finishing the task. (Many people will say you can't always succeed in developing exactly what you wanted in the beginning, they are mostly correct, but you can always try to :)... I will talk about it in the "Importance of critical thinking with the right mindset" section).

The steps to change your mindset

Step 1: be aware of your attitude when working on something new

Try to follow your mood when you are working on something new. In my opinion, it doesn't matter how you follow it (write your thoughts in a diary or try to remember when you think about it), the important thing is to develop an awareness of this subject.

Step 2: Find your weaknesses and your strengths.

For example, I know that one of my weaknesses is trying many things myself without asking for help. This mindset can cause a waste of time (even though I know I can finish it by myself) - I can waste a few hours instead of someone helps me, and it can be done in a half-hour. If you think about it, in this situation I can save the company I work for, a lot of money (my half-hour + my co-worker half-hour < few hours of my time). But on the other side of this example, it's one of my strengths - I will never quit on something I need to do.

Step 3: Choose one weakness you found from the last step and work on it.

If we take my previous example for the explanation - my plan is not always to ask for help (because it can cause the opposite of what I try to achieve). I need to see when I spend too much time on something and need to think about the cost of someone else who will help me. If I know the cost is worth it, I need to ask for help. But, more importantly, remember your strengths and make them your primary mindset.

Be confident you can do the task you got

In my opinion, this is one of the most important mindsets when you solve a challenging task. Why? without it, you are mentally weak, when you don't believe in yourself, the task you received seems too hard. But, if you do believe in yourself, you will do anything to complete the task.

Example of the right mindset

Let me give you an example from one of my last private projects - a game called "Gold Rush." The main goal of this game is to collect more coins than your opponent. There are two options - single-player and multiplayer. I will talk only about the single-player option. The user plays vs. the computer in the single-player option. The computer will collect the coins and pass obstacles, so I needed to implement a path-finding algorithm. At that time, it didn't sound to me that hard, so I decided to write the code myself. My design was very simple - matrix with two-player (0,0 and n-1,n-1) and random obstacles (there are obstacles in the game that the players need to pass). The main goal was - when the computer player moves, he will search for the coin, obstacle, or player 1. This design failed completely for a lot of reasons, but the main was - when he detected an obstacle or player 1 - he tried to do random index generation from the indexes in the matrix near to him (search up, down, right, or left - only four random options in this case). What happened was he repeated the same moves again and again, and the game seems stuck. I must admit, at that point, I felt like a loser, But I told myself I am not giving up yet... I searched for a solution on the internet, and I found this article: A* Search Algorithm in JavaScript (briangrinstead.com/blog). Even though it was written very clearly, I didn't succeed to implement it in my code. Honestly, I felt like shit, it's been a week, and I didn't do anything. But, I knew I am getting very close. Eventually, I found this npm package - pathfinding and succeeded in ending this task (after a week and a half). If you want to play the game here is the link : Gold Rush Game and here is the code I talk about (the backend): Gold Rush - backend.

Importance of critical thinking with the right mindset

I believe that you understand the importance of the right mindset after this example. But, I think the important in all attitudes is to remember that your approach will impact other things. for example, if you take the mindset I talked about, you can mistakenly think you can finish the task in no time, and this why is important to have critical thinking with the right mindset. Let's take, for example, the following scenario: you received a task to build a new service that no one in your company ever developed before. The mindset in this scenario should be "I can do it, and I will do anything to complete the task," but don't be arrogant, don't say you will complete the task in a few hours or a short time. Be honest with yourself and think how long it would take to do it.

Thank you for reading. I really would appreciate it if you comment your opinion about this subject because this is a new subject I explore and will be happy to learn more from others.

Discussion (12)

Collapse
destynova profile image
Oisín

"For example, I know that one of my weaknesses is trying many things myself without asking for help." -- this can slow you down in the short term, but on the other hand it's a sign of a learning mindset, where you try to figure things out yourself rather than getting bailed out whenever things get difficult. I prefer to err on the side of trying to solve things with minimal assistance for that reason, although of course it depends on the situation.

Collapse
tomeraitz profile image
Tomer Raitz Author

Thank you @destynova for your kind words! I think you are right, but there is one point I want to emphasize. As you said, the learning mindset is critical for developers, and you should always be in this mindset. But, in "real life" (businesses), you should be careful with it. As I wrote in the "Importance of critical thinking with the right mindset" section - you need to see what the mindset you are in and how it impacts your work. So I still think it is a weakness - not for myself as you said, rather for the company I work for. I genuinely believe for maximizing the "right mindset," you should recognize your weaknesses.

Collapse
destynova profile image
Oisín

Fair point! But I think it's important to step back sometimes and be careful to avoid too much focus on visible short-term gains for the company, since it can result in missing the bigger picture for long-term opportunities and ideas.

I worked in a small startup once, directly interacting with a CTO who constantly said things like "we need some quick wins". Needless to say, I felt immediately under pressure and stopped thinking about long-term possibilities or learning. Within about 3 months of being hired, I decided it was time to leave before things got worse. At that point I realised why people hired before me never seemed to stick around either :D

Thread Thread
tomeraitz profile image
Tomer Raitz Author

Good point I didn't think about it, seems your decision was correct (in my point of view), I wish you good luck :)

Collapse
z2lai profile image
z2lai • Edited on

So true, confidence is key to being successful. But people tend to have the reverse mentality - being successful is the key to being confident. Which is why I like the motto: fake it till you make it.

p.s. your gold rush game is awesome!

Collapse
tomeraitz profile image
Tomer Raitz Author

Thank you @z2lai , I think your words are gold! It seemed you really understood my point. But in my view, be careful on "fake it till you make it" in programming. There are some paths you are absolutely sure you are on the right way to a solution and it doesn't always work (like my example in the article). I think you need to be flexible and creative with your solution, but I believe you probably understood the point - this process requires confidence :).

p.s thank you very much for playing my game and for your kind words.

Collapse
giladberg profile image
Gilad Bergmann

Amazing!!

Collapse
tomeraitz profile image
Tomer Raitz Author

Thank you

Collapse
mostafijurrahman299 profile image
Md.Mostafijur Rahman

Great!!

Collapse
tomeraitz profile image
Tomer Raitz Author

Thanks :)

Collapse
chrismulvanygh profile image
Chris Mulvany

Great read!

Collapse
tomeraitz profile image
Tomer Raitz Author

Thanks :)