icon cloudapp
icon email
Getting Unstuck
Steven Hicks
@pepopowitz
steven.j.hicks@gmail.com
stevenhicks.me/getting-unstuck
steve/steven
contact info & url
milwaukee
Artsy, where we're building a platform for collecting and discovering art.
thank you to the organizers of you got this
Survey time!
What is your experience level in your career? (Beginner, Intermediate, Advanced)
Have you gotten stuck on a problem recently? (Yes, No)
If you prefer to think of it as junior/mid/senior, feel free
Stuck
"Stuck" is a nebulous word.
Not very clear.
So I want to be clear about what I mean when I say "stuck".
Stuck is when you've been looking at code for minutes, or hours, or days, that you SWEAR should be working.
You've gone over it many times, and you can't figure out why it's not doing what you think it should be doing.
You've been looking at it so long you're frustrated.
...
I do a lot of different things at Artsy -
I work with javascript, react, ruby, rails, SQL, elasticsearch,
I like to say I specialize as a generalist
But the one thing I love to do regardless of tooling is to help people get unstuck.
I've also got a lot of teammates who are great at getting people unstuck.
I've taken notes on how we get each other unstuck, and I want to share some tips with you.
0. Embrace
The Stuck
The first thing I have to offer you is less of a strategy
and more of a mindset shift.
Survey time!
#1. What is your experience level in your career? (Beginner, Intermediate, Advanced)
If you prefer to think of it as junior/mid/senior, feel free
(describe the breakdown)
Survey time!
#2. Have you gotten stuck on a problem recently? (Yes, No)
Beginners, take note.
This happens to all of us
If you're waiting for a day when you no longer get stuck...it's not coming.
0. Embrace
It may feel frustrating and like youβre doing it wrong, but that is the practice .
Will Doenlen, "To start meditating, stop trying to empty your mind"
My friend Will wrote an article called "To start meditating, stop trying to empty your mind"
Many newcomers to meditation think that they are bad at it, because their mind is not empty.
Their mind wanders, and they think about lots of different things.
...
Will makes the point that HAVING an empty mind is not what mediation is about, especially as a beginner.
It is about mindfulness , and noticing that your mind is wandering.
And that's it. (read quote)
...
Similarly, when it comes to getting stuck....
0. Embrace
Getting stuck isn't a reflection of your skill level
0. Embrace
Getting stuck isn't an impediment preventing you from doing the job
0. Embrace
Getting stuck
IS THE JOB.
This is what we're getting paid to do! To get stuck, and then get unstuck. This is our unique skill. It's why we get paid to do our job instead of someone else.
0. Embrace
Your job is to
solve problems
It's okay to be stuck - that's just you doing your job -
which is to solve problems, not write lines of code
0. Embrace
Solving problems takes time
So it's okay if it takes you a while
...
with that, let's see some more actionable strategies -
1. Explain
Write about the problem
1. Explain
Write
Email
Slack
StackOverflow
Blog post
Journal
GitHub issue
#dev-help
You might not even have to send the message!
Just writing it up might be enough to help you find the problem.
1. Explain
Talk to the duck
Explain what it is
Comes from a story in https://en.wikipedia.org/wiki/The_Pragmatic_Programmer
Doesn't have to be to a duck
Doesn't have to be to a real THING
But it can be a real thing
it can be imaginary
But it is definitely most effective when it is out loud
Explain the problem to the duck.
Walk them through the code. Out loud.
1. Explain
Talk to a person
Maybe you feel weird talking to an inanimate object and you'd prefer...
Same thing as before, except your coworkers are the duck
Ask them to come look over your shoulder
Explain the problem,
what is/isn't happening,
and walk them through the code.
1. Explain
Pair with a person
Taking "talk to a person in a duck costume" a step further
we pair a TON at artsy
not all the time - that can overwhelm people
but a couple hours a day works really great for tricky problems.
1. Explain
Why do these work?
1. Explain
Why?
Protege Effect
The best way to learn or understand something is to teach it.
if you've ever taught someone something,
through 1on1, or a lunch n learn, or a workshop, or teaching interns,
or even writing a blog post about a particular topic and finding yourself researching it so that you understand it deeply enough to write the blog post,
you've experienced this.
...
Now you're not teaching someone a skill when you're explaining why you're stuck...
but you're teaching them your mental model of the problem space .
...
A couple things that happen when you're teaching something:
1. Explain
Why?
Protege Effect
Inspires you to learn the topic thoroughly
Because you're going to have to explain it,
& you don't want to look a fool,
you use better learning strategies.
1. Explain
Why?
Protege Effect
Inspires you to think about how you'd learn the topic
...
It also has a meta effect - while learning, you're thinking about how you're learning
and how others might best learn it
Psychologists call this "metacognitive processing".
1. Explain
Why?
Challenge assumptions
The other thing that happens when you explain something to someone:
To prove that the code you think is running is actually running
...
IMO, This is the most critical and important thing about ALL of these "explanation" strategies:
They prompt you to challenge assumptions.
1. Explain
Why?
Challenge Assumptions
"Experience this one thing for what it is, not what you think it is."
Mihaly Csikszentmihaly, "Creativity: Flow and the Psychology of Discovery and Intervention", 1997
this makes me think about some ideas from Mihaly.
Mihaly - wrote "Creativity"
psychologist who introduces concept of "Flow"
it's kind of philosophical, almost zen
....
this is similar to what I remember being taught in art class
And what my kids are learning about their art
1. Explain
Why?
Challenge Assumptions
Draw what you see, not what you THINK you see
1. Explain
Why?
Challenge Assumptions
Symbols vs. Reality
When we see this drawing, we recognize it instantly as an eye
But that's not what an eye looks like.
That's just a symbol of an eye. A shortcut, or a heuristic.
1. Explain
Why?
Challenge Assumptions
Symbols vs. Reality
This is what an eye ACTUALLY looks like
It's not a symbol, or a heuristic
It has incredible detail and subtlety.
lots of colors in iris
reflection of lashes
bloody fleshy thing in the corner
1. Explain
Why?
Challenge Assumptions
Symbols vs. Reality
When you are focused on a problem in your code, you use symbols.
You make assumptions.
You build up this model in your head of all the pieces that are working together.
We treat them in our head as black boxes.
They are symbols, and you just assume they work as intended.
1. Explain
Why?
Challenge Assumptions
Symbols vs. Reality
But behind each black box lies complexity & detail
...
So much complexity that if wee don't treat them as black boxes....
1. Explain
Why?
Challenge Assumptions
Symbols vs. Reality
We couldn't possibly understand the system. There would just be too much going on.
Too many details.
When you get stuck, it often means our symbols don't reflect reality.
Our black boxes aren't doing what we think they're doing.
Explaining the problem forces you to evaluate every assumption and every black box, and explore the details of each of them.
And that's when you uncover the issue.
2. Isolate
Risk analysis
Isolating the problem starts with some risk analysis.
Ask yourself some questions
2. Isolate
Risk Analysis
What is the thing I've introduced that I know the least about?
What is the thing most likely for me to improperly use?
What is the thing I'm making the most assumptions about?
A dependency, or some new code, ...
A dependency, or some existing code, ...
Anything.
If you can give a solid answer to any of those questions,
there is a good chance that's where your stuck is coming from.
2. Isolate
Remove code
Whether you were able to answer any of those questions,
you can start removing code to isolate the source.
2. Isolate
Remove Code
Delete code iteratively
2. Isolate
Remove Code
Delete code iteratively
This isn't always as simple as just deleting lines - often you'll need to rewrite code to accommodate the deleted lines.
But you've removed complexity.
2. Isolate
Remove Code
Delete code iteratively
And eventually, you'll be able to isolate a smaller block of focus.
And then instead of dealing with 50 lines of code that don't work, you have 10.
2. Isolate
Remove Code
Back out your changes iteratively
We can apply this process to our recent changes, too, and back them out one at a time.
If your code is a timeline of commits (using git)
Assuming everything worked before you started making changes,
You can iteratively reverse them until things are working again.
2. Isolate
If you think of your system as this super sweet lego camper
And something in it isn't working right,
2. Isolate
Code removal is like taking it apart.
Pulling sections off, until you find that you used the wrong piece.
...
Sometimes though, we aren't even sure we have the right pieces to BUILD the camper.
2. Isolate
We don't know if the pieces are going to fit together.
We don't know if the wheel is going to work with the windshield is going to work with the raft,
And maybe the reason we're stuck in this code is because these couple of dependencies are completely incompatible with each other.
In these cases, it's useful to isolate by ....
2. Isolate
Build a proof of concept
building a proof of concept that these pieces can play together nicely.
Demonstrate the problem or subsystem, so it's easier to identify/fix the bug
Build it in a sandboxed environment, with only the required pieces to prove the implementation.
...
a lot of times we're stuck because we
don't know where to start: analysis paralysis .
We know we need to build this thing but there's all this complexity,
and when we start trying to build it we get lost in thought.
...
a proof of concept can help, but you don't always know what concepts to prove.
2. Isolate
Eat The Frog
2. Isolate
Eat The Frog
Eat a live frog first thing in the morning and nothing worse will happen to you the rest of the day.
Mark Twain
2. Isolate
Eat The Frog
When you're faced with building a system with a bunch of pieces
And you don't know which pieces to start with
top-left: ui
top-right: rails app
bottom-left: elasticsearch
bottom-right: mongodb
2. Isolate
Eat The Frog
Choose the scariest thing about this system - the most risky - and start there.
You can throw away the code afterward!
But it will get you moving.
And it gives you information about how this system will eventually come together.
...
If the "hardest problem" seems too big...
2. Isolate
Eat The Frog
try to identify multiple problems in it,
separate them,
& approach them one at a time.
Starting with the scariest.
2. Isolate
Write tests!
Writing tests is one of the most useful skills for solving a problem.
cuz testing is the best way to tighten your development feedback loop
of making changes, observing their effects, and repeating the cycle.
2. Isolate
Write Tests
Whether it's through unit tests of a tree of function calls,
integration tests of a tree of components,
or end-to-end tests of a running app,
2. Isolate
Break down problems
Common thread for "isolation" strategies ^^^
Help break a problem down from something large to something small
When it has a smaller surface area, it's easier to figure out.
3. Escape
Relax
Take a shower, take a nap, ....
When you relax, and shut your brain off from a problem, and let it wander,
other areas of your brain activate, and can find solutions without you trying.
you're also more open-minded to the problem - and less likely to dismiss ideas that don't seem obviously related.
Relaxing is just a great way to be creative.
3. Escape
Physical exercise
Increases blood flow to brain
improves executive functions
Improves mood (which can give you the push you need to get back at the problem)
If rhythmic & repetitive, your mind can shut off & wander
3. Escape
Other hobbies
Similar effects to resting - our brain explores new ideas
this is a very individualized strategy -
ash plays guitar,
maybe you like to draw,
i like to exercise.
3. Escape
Move on to another problem
Put this one aside. Work on something else you know how to solve.
This feels like a more productive version of escaping.
3. Escape
Why do these work?
3. Escape
Why?
1. Escaping can boost your confidence
Solving a simpler problem, for example, gives you confidence that you can use to smash the original harder problem.
I do this in rock climbing. I lose confidence working on a hard route.
After completing a couple simple climbs, I can attack the original problem with renewed confidence.
3. Escape
Why?
2. When you come back to the original problem, you have to re-learn it a bit
a. This can help you challenge assumptions, like talking to the duck.
b. When you rebuuild your mental model of the problem, you might get those symbols/abstractions right that you were getting wrong beefore.
3. Escape
Why?
3. Your brain might come up with the answer while thinking about other things
3. Escape
Why?
Analogical problem solving
use information from one domain (the source or analogy)
to help solve a problem in another domain (the target)
http://cognitivepsychology.wikidot.com/problem-solving:analogy
...
This happens when you notice parallels between two very different activities;
this prompts you to notice OTHER parallels between them
which can include a reframing of the problem in a way you hadn't before.
3. Escape
Why?
Incubation
3. Escape
Why?
Incubation
5 Stages of Creativity
Preparation
Incubation
Illumination
Evaluation
Elaboration
Mihaly Csikszentmihaly, "Creativity: Flow and the Psychology of Discovery and Intervention", 1997
originally proposed by a political scientist named Graham Wallas in the 1920s,
Mihaly C refined the stages of creativity to what you see here.
1: problem is investigated consciously, in many directions
2: you put the problem away. Do nothing, or do a different problem. Subconscious processing.
3: the preparation & the incubation come together, and you have a sudden insight.
4: vet the idea. look at it critically.
5: expand on your new ideas. Test them, refine them, figure out how to best apply them.
...
These don't happen in isolation -- they play together.
Mihaly describes incubation really well:
3. Escape
Why?
Incubation
...ideas churn around below the threshold of consciousness . It is during this time that unusual connections are likely to be made.
Mihaly Csikszentmihaly, "Creativity: Flow and the Psychology of Discovery and Intervention", 1997
3. Escape
Why?
Incubation
When we intend to solve a problem consciously, we process information in a linear, logical fashion. But when ideas call to each other on their own, without our leading them down a straight and narrow path, unexpected combinations may come into being.
Mihaly Csikszentmihaly, "Creativity: Flow and the Psychology of Discovery and Intervention", 1997
3. Escape
Why?
Incubation
He even goes on to compare this to parallel computing, right in our wheelhouse:
when we are consciously thinking about a problem, we push it in a linear direction.
3. Escape
Why?
Incubation
when we let it incubate, it expands to parallel processing.
This allows a freedom to your problem solving:
things can combine in ways that your conscious mind would reject.
3. Escape
Set It Aside
Often when we're faced with a difficult problem, we think we need to really focus on it.
We think that we are procrastinating if we aren't actively attacking it.
But the truth is, for really complicated problems, where your brain and your creativity need to expand in many directions to find a solution, staying actively focused can be a detriment. Giving your brain some room to explore the space, on its own time, can help you explore ideas that your focused, rational mind would initially reject.
walk
work out
Take a shower
or a nap.
Read a book about something unrelated.
basement - woodworking.
Knit.
mountain biking, trail running, rock climbing.
Let your brain expand this problem in many other directions.
4. Harden
Getting stuck IS THE JOB
4. Harden
Learn new ways to solve problems
Pair (even when not stuck)
read code in other projects
explore new technologies
learn for the sake of learning
4. Harden
Wall of motivation
I keep a trello board that I fill with messages of appreciation & thanks, I call it my wall of motivation.
There's a talk in the You Got This talk library by Gargi Sharma about making your work visible, she mentions Julia Evans's idea of the "brag doc" -- pretty much the same thing
...
Just as important as keeping it is looking back on it now and then
If you're like me, when you get stuck, your self-talk changes for the worse.
You start doubting yourself. You start saying awful things about yourself. Your impostor syndrome kicks in hard.
A wall of motivation can replenish your ego , as long as you remember to look at it, ...
4. Harden
You're doing a great job!
β€οΈπ€οΈβ€οΈπ€οΈβ€οΈπ€οΈβ€οΈπ€οΈβ€οΈ
and it can help remind you -
you're doing a great job.
It might not always feel like it.
But this work is hard.
And it takes time.
4. Harden
Keep a journal
Keep a list of things you do every day - so you can see that you are getting things done.
Sometimes they may not be huge like shipping a feature,
but if you celebrate your learnings, your discoveries, even small steps forward,
you can look back and see that you're doing your job of solving problems.
4. Harden
Exercise
Can reduce anxiety & depression
I particularly recommend rock climbing
Hardens your problem solving skills & persistence.
4. Harden
Meditation
Variety of mental & physical benefits
Especially leveling your emotions, which can factor into getting stuck
and increases your ability to persist through challenges
4. Harden
Talk about your struggles
Get outside of your head.
Do more active 1on1's with your leader, or someone else that you feel psychologically safe around.
Someone you can be vulnerable with.
Talk about the times you felt stuck.
4. Harden
Condition yourself
Common thread for hardening strategies:
Get in the reps
Strengthen yourself
Professional athletes condition themselves for incredible physical challenges.
Professional developers need to condition themselves for incredible mental challenges.
Summary
0. Embrace : Getting Unstuck Is The Job
1. Explain : Challenge Assumptions
2. Isolate : Break Problems Down
3. Escape : Set It Aside
4. Harden : Condition Yourself
...
4 - harden yourself for the next time.
Because you are going to get stuck again.
and that's okay!
Thank you!
Steven Hicks
@pepopowitz
steven.j.hicks@gmail.com
stevenhicks.me/getting-unstuck
Thank you for your time!
Questions afterward
Enjoy the rest of ___
icon cloudapp
icon email
icon twitter
Getting Unstuck
Steven Hicks
@pepopowitz
steven.j.hicks@gmail.com
stevenhicks.me/getting-unstuck