DEV Community

Cover image for How puzzles šŸ§© help me code šŸ’»
Gedalya Krycer
Gedalya Krycer

Posted on

How puzzles šŸ§© help me code šŸ’»

Ok, I know what you are probably thinking...

This post will be about how puzzles train your brain to solve more complex problems, just like practicing with HackerRank or LeetCode.

However, this is not that kind of post.

Doing puzzles have not helped me to become a cleverer developer.

Rather, puzzles help me set a healthier expectation on how to define progress.


Let's rewind a bit...

A few months ago I got a lovely welcome package from my new team at Planning Center.

One of the items was a puzzle that when completed, shows some of our main products as the MCU Avenger characters. Super cool!

PCO Avenger Puzzle

Now, I don't enjoy doing puzzles. Since childhood, they have given me headaches. But, I do love the Avengers and if I could learn JavaScript, could this really be much harder? šŸ˜†

So one afternoon I dumped all the puzzle pieces out and gave it a shot. I immediately felt overwhelmed. So many seemingly non-sensical shapes and colors.

I thought to myself "Ok, got to do at least something, right?"

So I spent the next 15 min separating all the edge pieces into a different pile. Admittedly, that one was smaller and less overwhelming to look at. Decided to call it a day at that point.


Later that week I needed to take a break during work and approached the pile of edged puzzle pieces.

After about 5 min I got 3 pieces to fit together. Nice! šŸ§©šŸ§©šŸ§©

The next day I got two more pieces together. šŸ§©šŸ§©

That Friday I got another 8 pieces figured out!! šŸ§©šŸ§©šŸ§©šŸ§©šŸ§©šŸ§©šŸ§©šŸ§©

By the next week, I had most of the edges done. šŸŽ‰

Puzzle edges

Today I moved to the middle and made some more progress on all the green pieces.

Puzzle green pieces

Taking it 5 min at a time made it actually enjoyable and validating to see it slowly take shape.


So how does this help you code again?

While working on this little puzzle side-project something dawned on me. I am making progress.

It is super slow, but each 5 min stretch of time spent on this is indeed contributing to the overall project. I don't need to solve the whole puzzle in one shot. I just need to get one puzzle piece figured out to move the whole thing forward.

I started to actively apply this idea in my designs and code...

It is so easy to beat myself up for spending 20 min on a function and not completing it. If I don't finish 100% of it, it can feel like all my efforts are for nothing.

However, is that really true?

What are the "puzzle pieces" that I did figure out? Did I find a good name for the function? Did I read 3 articles on guard clauses which will help me set up future conditionals? Did I find the right file to make an edit in a code base of 100 files?

These are small pieces, but they are all valid and necessary in getting the whole thing done.

Instead of being discouraged, these little achievements are all signs of progress that I can be encouraged by.


In conclusion

Doing this puzzle has been a reminder to be strategic and to have some grace.

  1. Break down the big scary problem into easier-to-understand parts.

  2. Don't discredit the small wins. They will lead to a much bigger victory.

Happy coding my friends! šŸ¤“

Top comments (0)