In Praise of Easy Problem Solving
Of all the types of puzzles in the world, crosswords are my favorite (with Sudoku not being far behind). I have many pen and pencil filled crossword books in progress, and occasionally do digital puzzles on my phone or computer. (I would say using pen means I'm confident in my answers, but really it's because pen feels better on my tendonitis than pencil going across paper.) Crosswords on paper are more relaxing to me though, as I get to spend some time away from technology. While helping to pack fragile kitchen items for donation during a house cleaning after a relative passed away, I took a break by solving one of the crosswords from the pile of newspaper I was given to use as wrapping.
So how does this topic relate to programming? Well only recently have I discovered programming practice sites such as HackerRank and Leetcode. When I was in college I only knew of Project Euler, and doing just a bunch of math problems didn't interest me at the time. All of my programming practice came from school projects and not any outside resources. Now there are so many more options for programming practice than there was when I graduated over a decade ago. I've delved into basic algorithm questions, database problems, and data science projects. We also have way more resources; Google has gotten bigger, Stack Overflow has grown, and there are plenty of forums to ask for help. It's more than just "Hello World" out there.
As I look through these problems I see plenty of things that I have done before. Concatenate a list? Sure, done that. Find the square root of every number input? Okay, done. It's like doing crosswords; the clue may be worded differently, but I remember what previously worked.
How do we learn? Through repetition. Anyone who does crosswords on a regular basis knows that questions and answers are repeated a lot. "ERA" is the most common word used for an answer. After a while solving crosswords becomes easier and easier, and we (I) don't have to check the back of the book for what an answer is when we (I) get stuck. I still have a post-it note where the solution to my puzzle is located, because let's face it, some days even the easiest stuff can be hard to figure out. Or I need a little push.
It's a great feeling to even see a simple problem and be like "Oh, I know this one!" since I had seen it before. Or even if I am stuck, and I see the solution and go "Oh, I know about this!" This morning I had that feeling while working on a simple f-string Python question on HackerRank.
It may seem silly, but I do enjoy posting my "You earned another star!" notifications on my LinkedIn page.
What I wish someone told me in college in any of my computer science courses was this; don't reinvent the wheel. Basically if you are stuck on a problem, don't stress yourself out about it. It does not hurt to have to look something up or ask for help. What I personally do is attempt to solve something myself first. Then, if I am still stuck after a period of time, I look for guidance. It's like having to check that answer in the back of the crossword book; when I get a little push, or find that one word I just couldn't figure out, then the rest of the answer falls into place.
Never be ashamed of just doing some simple problems, even in programming. "I feel like I should be doing harder things." You could be, yes. But it still doesn't hurt to do some of the smaller problems again, just for that repetition.
Next time you get a problem asking you to solve it using an f-string, just remember; this is how we learn.

Comments
Post a Comment