The secret to problem solving and figuring stuff out
I'm feeling pretty great about something that happened at work recently. (Yeah, sorry, this is gonna be the brag edition of the newsletter, but hopefully it gives you some inspiration.)
Our team needed to create a process for collecting comments on our internal documentation. Our existing knowledge management system (KMS) is garbage and doesn't have a great way to collect and analyze comment data, so we had to get creative.
Initially, this process was going to require manually copying and pasting every single comment from the KMS into a spreadsheet, and then we could analyze the comments from there.
Yeeaaah, no way I'm letting that happen. So I went to the drawing board to figure out a better way.
I've played around with the KMS's API before, which allows you to integrate software with other software. I figured I could use it here. In this case, I used the API to pull comment data into a spreadsheet automatically. This required some code, which I'm mostly familiar with, but there were some things I needed to figure out.
I needed to fetch the data from the KMS using an API call, which is nothing more than a URL and a few lines of code. This part was easy.
Since an API call fetches only the first 25 comments or so, I needed to loop through multiple API calls, each fetching the next page of comments, 25 at a time. I'd never done this before, so I had to figure this out.
Once all the comments had been fetched, I needed to parse that data and lay it out in a spreadsheet. I've done this before, but this would be more complicated than anything I've done in the past.
This would be a cakewalk for an experienced software engineer, but I'm not a software engineer—just a hobbyist, at best.
After nearly 150 lines of code, I got everything to work. Granted, it's not the prettiest code, nor the most efficient, but it works!
But I want to highlight how many times I got stuck and had no clue how I was going to get it to work. I genuinely had several moments where I thought I'd have to call it quits and go back to the drawing board.
For example, I got the code to the point where it was fetching comments and laying them out in the spreadsheet, but it wasn't fetching all the comments, and I had zero clue why. I felt like what I was trying to do was far above my capabilities
I decided to take a break and come back to it the next day, because I solve problems best when I sleep. We all do. Sleeping doesn't necessarily solve the problem, but it helps reset the brain and think about things differently.
Turns out, I came back to the code the next day and figured out the issue. And damn, it felt amazing!
Here's your takeaway: If you have a difficult problem to solve, take a nap.
Happy Hour
Fun things I’m doing, TV shows and movies I’m watching, games I’m playing, music I’m listening to, and other neat stuff I want to share.
You may remember when I talked about how I'm no longer chasing the best smartphone camera and instead relying on my Sony a6300 to take my fancy pics. Well, I downgraded my smartphone from an iPhone 13 Pro to an iPhone 13 Mini. I've always been intrigued by a small form factor, and the Mini fits the bill perfectly. Does it have the best smartphone camera? Nope, and I don't care!
Thanks for reading! I’ll see you in two weeks. In the meantime, catch up on some older newsletter issues if you’re a new subscriber, and feel free to follow me on Instagram for my off-hours shenanigans.
Also, if you think a friend or family member would enjoy this newsletter, feel free to forward this email and tell them to subscribe!