Talks

Getting Unstuck: Strategies For Solving Difficult Problems

Getting Unstuck: Strategies For Solving Difficult Problems

by Steven Hicks

In the video titled "Getting Unstuck: Strategies For Solving Difficult Problems" presented by Steven Hicks at RailsConf 2019, the speaker addresses the common challenges faced by developers when encountering difficult problems in coding, emphasizing that getting stuck is an inherent part of the engineering process. Hicks provides a variety of strategies designed to help developers reframe their mindset about getting stuck as part of their job.

Key Points Discussed:

  • Mindset Shift: Understand that feeling stuck is normal for all developers, regardless of experience level. Getting stuck is part of the job, emphasizing that solving problems is the primary responsibility of developers.
  • Explain the Problem: Start by verbalizing the problem, either by writing it down or explaining it to someone else (even a rubber duck). This method allows you to articulate your thoughts and often leads to insights that help solve the issue.
  • Isolation Techniques: Hicks advocates for isolating the problem by analyzing it, removing non-essential code, or using version control to identify when an issue arose. This can simplify complex issues into manageable parts.
  • Taking a Break: One of the most effective strategies is to step away from the problem. Engaging in physical activities, taking a nap, or doing something unrelated can lead to a fresh perspective and unexpected insights through concepts like incubation and analogical problem-solving.
  • Conditioning for Future Challenges: To prepare for future challenges, Hicks recommends learning new skills, regularly pairing with others for brainstorming sessions, and maintaining a positive mindset, for instance by keeping a journal of achievements.

Examples and Illustrations:

  • Hicks employs an anecdote about feeling good while helping colleagues get unstuck, portraying the camaraderie in development teams. He also mentions the “Protege effect,” illustrating how teaching others deepens your understanding of a topic.
  • Programmers can benefit from keeping a record of their successes to build confidence and combat self-doubt when they face new challenges.

Conclusions/Takeaways:

  • Getting stuck is an integral part of programming, and learning to embrace it will lead to more effective problem resolution.
  • The strategies shared, especially explaining problems, isolating issues, taking breaks, and cultivating a growth mindset, can significantly enhance a developer's problem-solving skills.
  • Developers should actively train their minds to tackle future challenges by learning and collaborating, reinforcing that problem-solving is both a skill set and a mindset.

Ultimately, the session encourages developers to view challenges as opportunities for growth rather than setbacks, effectively turning frustration into productive learning experiences.

00:00:20.689 All right, welcome to day three of RailsConf! I want to thank Barrett here up front for inviting me to be part of the self-care track. I'm super excited, and I appreciate all the organizers. I helped organize an event down in Milwaukee, and it's a lot of work, so if you get a chance to thank anyone in a green shirt, please do.
00:00:35.190 My name is Steven, but people call me Steve, which can cause confusion on Twitter. I'm at PEP O Pio WIT Z. There's a story behind that, but it's not that interesting. If you want to get in touch with me, my email is [email protected]. If anyone is curious, all the slides we'll go through are available online at stevenhicks.me/getting-unstuck.
00:00:46.530 I am an engineer at a company named Artsy. Artsy is based in New York, but I am not. I am based in Milwaukee and work from my basement, which I affectionately call my spider hole. Our mission at Artsy is to expand the art market by providing a platform for collectors to discover and buy art.
00:01:06.300 I started at Artsy about six months ago, and that is when I wrote my first line of Ruby code. I'm new to this community—brand new, in fact. Just this past Monday, I tried to write my fifth line of Ruby code, and unfortunately, I ran out of time! Before that, I had been a JavaScript engineer for honestly about 20 years.
00:01:22.770 There are some things I’ve noticed about the Ruby and Rails community already. For starters, you all really love the heart emoji, and I'm cool with that—I can get behind that. The other thing I've noticed is that it seems like there are always 18 different ways to do any one thing in Ruby code, and that’s great.
00:01:34.259 I don’t know how you all manage that without getting into arguments about style. What I've come to realize is that when you do have discussions about style, you automatically win the argument if you just say, "That's idiomatic." Like, if one of the parties says 'idiomatic', everyone has to drop it and walk away. So, while I don’t know much about Ruby or Rails, I do know some things about getting unstuck.
00:01:58.020 One thing I want to clarify is what I mean by the word 'stuck' because it's a nebulous term. Being stuck is when you’ve been working on code and looking at the same code for an hour, a day, or even days, and you’re frustrated because you can’t figure out why it doesn’t work. Why isn’t the code doing what it should be doing? Why is it doing something it shouldn’t be doing? This frustration is common.
00:02:20.610 What I love in development is when someone in a standup says, 'I feel like I’m stuck on this problem and I can’t move forward.' I get an adrenaline rush from that, and I think it's great. I would love to sit and pair with you to help get you unstuck. Over the past few months, I have been taking notes on the strategies I use to help myself and what my coworkers do to get unstuck, and I want to share those notes with you today.
00:02:50.670 The first thing I have to offer is not so much a strategy as it is a mindset shift: let’s embrace the act of getting stuck. Quick survey in the room: let’s do a show of hands. Who here considers themselves a beginner in development? Maybe you call yourself junior, or maybe you don’t. Okay, that looks like about a quarter of the people in the room. How about those who consider themselves more mid-level? And then how about senior level? You've been doing this for a while, and you feel pretty good at it? Okay, that’s a pretty even breakdown, but slightly fewer juniors than the rest.
00:03:37.520 Here’s the second question: raise your hand if you feel like you’ve gotten stuck on code in the last month or so. Hold them up! I want the juniors to look around the room and notice that everyone has their hand up right now. You can put them down.
00:04:02.340 While you may feel as a junior engineer that someday you won’t get stuck on code, I’m really sorry to tell you that is not the case. You will still get stuck; it’s just going to be different problems that you encounter. My coworker Will wrote an article called 'Stop Trying to Empty Your Mind,' where he discusses the practice of meditation.
00:04:33.000 He explains how beginners, especially, think they’re bad at meditation because their minds are constantly racing, filling up with thoughts. Will's point is that this is not what meditation is about. It’s not about having an empty mind; it's about recognizing your thoughts, acknowledging them, letting them go, and returning to focus on your breath. It may feel frustrating, and you might think you’re doing it wrong, but that’s the practice.
00:05:12.400 Similarly, when it comes to getting stuck with your code, being stuck is not a reflection of your skill level or experience. As we saw with that tremendous show of hands, it is not an impediment preventing you from doing your job. In fact, getting stuck is part of the job.
00:05:32.900 Getting stuck is why we’re paid to do this instead of someone else, because we can wrestle with a problem, pound our heads against it, and then eventually find a way to get unstuck. It’s okay to be stuck because that’s just you doing your job, which turns out is to solve problems. Writing code is merely a tool that you can use to solve problems, but that’s not the primary focus of the job.
00:06:09.250 And it’s alright if it takes you a while because solving problems is inherently difficult and time-consuming. With that, I would like to share some more actionable strategies. I have divided the remaining strategies into several groups.
00:06:52.670 The first group I call 'explain the problem.' Explain it to someone else. Start by writing about the problem. Write down everything you can say about your code and the issues you're experiencing with it. You can do this in various places: write an email, which people still do, or send a message in Slack, which everyone does.
00:07:16.420 My favorite option on this list is to write a message in Slack to the Slack bot. The truth is, most of the time before you even finish writing the message and send it, you figure it out on your own.
00:07:37.000 Perhaps you are more of a verbal person. In that case, you can talk to a rubber duck. If you've not heard of talking to a duck, you might know it as a rubber duck debug. The idea is to keep a small rubber duck at your desk. When you get stuck on your code, pick up the duck and start explaining your problem to it, verbalizing the problem. You can say, 'Look over here, this is the problem I’m having. Here's where I think I’m passing this into here.'