r/ProgrammerHumor • • Sep 25 '16

When fixing one bug leads to another

https://i.imgur.com/rQIb4Vw.gifv
11.0k Upvotes

185 comments sorted by

732

u/EquationTAKEN Sep 25 '16

This is called yak shaving.

That is when investigating one thing, leads you to discover other stuff that needs doing.

203

u/seanmac2 Sep 25 '16

Yak shaving is bad for short term productivity but it's incredible for learning. Shave a few yaks and pretty soon your the best god damn yak shaver, mooshi pillow fixer, and car waxer around.

84

u/Franks2000inchTV Sep 25 '16

I am an amateur developer, but my programming has taken a huge leap forward since I figured this out on my own.

I used to work and work and work and get nowhere, and I now know it was because I was "yak shaving." I'd end up way down in the rabbit hole, breaking a bunch of stuff on my way down and with no way to find my way back when I was done. . Now I have a really board where I track issues and when I discover something in the code that needs to be done I just make a trello card and move on.

Actual things are actually getting built now! It's amazing!!

It's nice to know it has a name! :)

34

u/sobri909 Sep 25 '16

Yep, that's the trick. Always stick to task. If you find something else that needs doing along the way, file it in the task tracker then go back to your original task. Don't leave the original task until it's complete or it really is blocked.

→ More replies (1)

13

u/cderm Sep 25 '16

Rookie self-taught programmer here, any more info on your workflow? I'm getting better but distractions are tough. Any videos or blog posts you'd recommend?

16

u/Franks2000inchTV Sep 25 '16

The main thing is picking one thing to work on, and sticking with it.

As I mentioned I have a trello board where I keep all my ideas of stuff to work on. (Here's a screenshot of the one for the project I'm working on now: https://www.dropbox.com/s/zjiv9kcpu13eixi/Screenshot%202016-09-25%2016.27.35.png?dl=0 (it's a tool to manage chores for my gf and I)

  • Step One: I look at cards in the "Tasks" column and decide on one I want to work on. Then I grab it and drag it into the "In Progress" column.

  • Step Two: Once I've decided I want to work on it, I create a new branch using git, and name something that's the same as (or close to) the card

So for the card "Resort list by urgency after completing a chore." it would be like:

git checkout -b resort-list-by-urgency
  • Step Three: Once I've checked it out, I start developing away.

The important part here is: If while I'm in the middle of working on the sort function, I realize something that needs done, like "Oh, this would be a lot easier if <some thing> was an array instead of an object." I DO NOT FIX IT. I used to think "oh I'll just fix it up while I'm here." and then boom, I am yak shaving. So instead I'll create a new card in trello that captures the idea and just leave it.

You can see one of these in the bottom of the "done" column -- it's called "Re-architect so data model lives in App.JSX". I've been learning react, and I realized halfway through that I had stored all the data in the wrong place. Ordinarily I would have dived in and fixed it, but instead I just made a card and came back later.

Once I'm done building the thing in the task, I do a bit of testing to make sure it's working.

  • Step Four: when I'm pretty sure it's working, I'll commit the changes to the branch, and push the branch to github

  • Step Five: Create a pull request on github. Double check that everything is working ok.

  • Step Six: Accept the pull request and merge the changes into master. Delete the branch.

  • Step Seven: Move the card into the done column and start again.

That's it!

By limiting myself to working on a single issue, it helps me limit the number of things I need to keep in my mind at once. I can focus on getting the thing working, and then move to the next thing.

Keeping everything on separate branches means that I always have a working version of the thing, in case I really screw something up. I can just copy over a working version from master.

So many times in old projects, I'd break things and then spend all this time chasing down bugs. Now I limit the scope of my work and stop myself from getting wrapped up like that.

→ More replies (3)
→ More replies (4)
→ More replies (1)

113

u/youre_real_uriel Sep 25 '16

Strange term for this concept.

61

u/spiffistan Sep 25 '16

What, have you never found yourself inexplicably shaving a yak?

28

u/mellow_gecko Sep 25 '16

Once. But it was a chicken, not a yack. And I wasn't actually shaving it.

27

u/[deleted] Sep 25 '16

Keep fucking that chicken!

→ More replies (1)

25

u/Salanmander Sep 25 '16

I feel like Factorio's entire gameplay is based around yak shaving...

16

u/[deleted] Sep 25 '16

except in factorio you never reach the yak. you just go in circles

12

u/Salanmander Sep 25 '16

Need more stone to make more smelters to smelt more copper to build more circuits make more miners to mine the stone you need to make the smelters.

6

u/zombieregime Sep 25 '16

So.....every survival game ever?

[Hides copy of Ark]

→ More replies (1)

14

u/[deleted] Sep 25 '16

Working a job at a video store is a great source for this. Oh, someone seems to have put Temple of Doom behind the Mr Bean's Holiday case. I'll just go ahead and swap th-- oh, Funny Farm behind Bean? Okay, funny farrrrrrm, nope.

Edit: a word

8

u/JDN3 Sep 25 '16

There's a few people at my company that call themselves "Members of the Yak Shaving Club"...now I finally know what that means!

3

u/ThrowAway_FolkFamily Sep 25 '16

The hell are you discovering on a yak while shaving it that you have to investigate?

7

u/[deleted] Sep 25 '16

It's more like you start off trying to tighten the hinges on a cabinet door, then somehow you end up shaving a yak.

→ More replies (1)

4

u/jewdai Sep 26 '16

i tried upgrading a drupal instance from 6.30 -> 8.0

I needed to do the following:

  1. upgrade linux (it was running on a version of debian two versions back)

  2. upgrade mysql

  3. upgrade php

  4. upgrade myphpadmin

  5. upgrade solr

  6. and on and on

i went on two week vacation and came back to the office saying "WE NO LONGER SUPPORT THIS" and walked away from the potential project.... i burned a month on it.

2

u/Bainos Sep 25 '16

I'll remember it. It's easier to use that "living the life of a RPG character".

-11

u/[deleted] Sep 25 '16

Is it "called" yak shaving if no one calls it that though? You'd just end up explaining the phrase every time you use it.

28

u/itaShadd Sep 25 '16

Do it enough times and, if there's no better term for it, people will start using it, if only to avoid exemplifying the concept every single time. In other words, the more you do it, the less you need to do it – inverse yak shaving if you will.

4

u/mellow_gecko Sep 25 '16

The next ten times I use the phrase, I'll probably have to explain it. But each of the nine people I'll have explained it to (one of my friends is a bit slow) will then explain it to ten more people. And so on. Until everyone knows that we should be shaving as many yaks as we can so that we don't run out of hose pipes before the winter.

→ More replies (6)

148

u/zehamberglar Sep 25 '16

Also the trade miniquest in every zelda game.

11

u/[deleted] Sep 25 '16

Also everything you ever have to do ever, if you have ADHD. I meant to clean the living room two weeks ago. I also need to do the dishes. Yet here I am, on reddit...

9

u/mysticrudnin Sep 25 '16

Not quite the same if you're not actually doing one of the tasks...

→ More replies (3)

0

u/[deleted] Sep 25 '16

[deleted]

17

u/Njs41 Sep 25 '16

Took me an entire day to get that done, and all I got was a stupid keychain.

8

u/TotesMessenger Green security clearance Sep 25 '16

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)

→ More replies (1)

574

u/PitaJ Sep 25 '16

Malcolm in the Middle was the best.

77

u/Mugilicious Sep 25 '16

It's all on Netflix last i saw

52

u/[deleted] Sep 25 '16

Only in some countries

46

u/poorly_timed_leg0las Sep 25 '16

Kickass.cd my one true love

14

u/[deleted] Sep 25 '16

Thank you, I was lost without them.

11

u/slash213 Sep 25 '16

Kickass.cd

That one is fake though. All it does is display results from Pirate Bay. Compare a query on both websites and you'll see.

→ More replies (7)
→ More replies (1)

19

u/crossbreed55 Sep 25 '16

Obligatory fuck Netflix for blocking VPNs.

→ More replies (13)
→ More replies (2)

-7

u/[deleted] Sep 25 '16

I've seen both that and breaking bad so many times I thought this was from the first season of breaking bad at first, till OH SHIT brunette wife.

5

u/[deleted] Sep 25 '16

Idk why the downvotes, this happens to me with other actors all the time.

→ More replies (1)

3

u/tafoya77n Sep 25 '16

I don't understand the downvotes I do the same thing.

0

u/[deleted] Sep 25 '16

[deleted]

37

u/SaftigMo Sep 25 '16

You mean, you were wondering why Hal became a drug lord?

17

u/MartyMcFIyy Sep 25 '16

The best ending to Breaking bad is the 5 minute clip where Hal is waking up thinking He becoming Walt was all a dream

→ More replies (1)

140

u/[deleted] Sep 25 '16 edited Sep 25 '16

I originally watched this show when I was Malcolm's age. I couldn't really relate, but it was hilarious. Now I am a dad of 2 kids and I recently started watching it again. I can relate 100% with the mom and dad.

That scene is relevant without interpretation. This shit happens to every homeowner that has kids.

Owning a home requires a lot of maintenance. Having multiple* kids exponentially increases the frequency at which things break. To make matters worse, when you have very young kids, you will either be strapped for cash and/or unwilling to invest** in quality material until your kids grow up.

  • 1 kid will behave, 2+ kids will trash a place.

*Because why buy quality/durable materials if your kids will trash it one way or another?

49

u/Merari01 Sep 25 '16

1 kid will behave

Unless you are my two year old nephew, who will show you an item, smile and say "broken" and then break it.

53

u/pa_dvg Sep 25 '16

Of course he will, he's 2, and he's discovered he has the power to alter his environment according to his whim. He feels like a tiny God.

That doesn't mean he won't cry when he realized breaking something he likes can't be reversed so easily.

19

u/Merari01 Sep 25 '16

..Now I am imagining that somewhere on Dunmanifestin there is this tiny god, squeeking: "You can't treat me like this! I am slightly omnipotent!"

17

u/poorly_timed_leg0las Sep 25 '16

Lol hey Jimmy it's your favourite toy

Waves in front of face

(͡ ͡° ͜ つ ͡͡°)

Throws on floor and stomps on it

"Broken"

Jimmy (ಥ﹏ಥ)

5 minutes later...

(ノಥ,_」ಥ)ノ彡┻━┻

"BROKEN! BROKEN! BROKEN!"

→ More replies (1)

8

u/ericstern Sep 25 '16

So is it like, he is holding a light bulb in his hand, he tells you "broken", and as he is looking at you straight dead in the eye he slams it into the ground.... kind-of-thing?

because IF SO.... that kid is going straight to hell

8

u/Merari01 Sep 25 '16

Oh yes. He even tried it with a phone once but his dad made a headlong dive and rescued it.

2

u/[deleted] Sep 25 '16

You are the second kid.

14

u/mofukkinbreadcrumbz Sep 25 '16

It's all houses, not just ones with kids.

Source: no kids, haven't had a free weekend from working on the house since March.

2

u/[deleted] Sep 25 '16

It's all houses, not just ones with kids.

Source: no kids, haven't had a free weekend from working on the house since March.

I wasn't talking about renovations.

4

u/mofukkinbreadcrumbz Sep 25 '16

Neither was I. I bought the house from an older couple. The amount of broken shit is insane. I haven made it to renovations yet, just fixing broken shit.

3

u/[deleted] Sep 26 '16

You kinda made your own bed with that one.

→ More replies (4)

5

u/[deleted] Sep 25 '16

*Because why buy quality/durable materials if your kids will trash it one way or another?

Quality/durable materials will last longer and might cost less in the long run. Vanity materials are a different story.

→ More replies (2)

65

u/Alucard256 Sep 25 '16

This is exactly why I follow the "5 second rule" (my term for it).

When I run into another problem while fixing something, I either fix it in 5 seconds and get back to the 1st problem, OR if that can't be done, I take 5 seconds and write it down, and get back to the 1st problem.

31

u/luxliquidus Sep 25 '16

A great idea, if you can. But if there is only one way to fix the problem, and that way is blocked... The yak must be shaved.

1

u/lgallindo Sep 25 '16

I use 5 min and carry a notepad with notes freaking everywhere. Too damn common at work.

→ More replies (1)

409

u/Chris857 Sep 25 '16

126

u/[deleted] Sep 25 '16

45

u/xkcd_transcriber Sep 25 '16

Image

Mobile

Title: DFS

Title-text: A breadth-first search makes a lot of sense for dating in general, actually; it suggests dating a bunch of people casually before getting serious, rather than having a series of five-year relationships one after the other.

Comic Explanation

Stats: This comic has been referenced 18 times, representing 0.0141% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

23

u/ballzoffury Sep 25 '16

Never thought about comparing dating to the BFS algorithm, but it fits!

90

u/xkcd_transcriber Sep 25 '16

Image

Mobile

Title: Success

Title-text: 40% of OpenBSD installs lead to shark attacks. It's their only standing security issue.

Comic Explanation

Stats: This comic has been referenced 103 times, representing 0.0804% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

22

u/Conkerkid11 Sep 25 '16

This is me last Friday when I couldn't start up a certain game, and by the end of it all I wasn't able to display anything on my monitor because I hadn't reinserted my RAM correctly.

10

u/BluFoot Sep 25 '16

Holy shit, one I haven't seen before.

2

u/qdhcjv Sep 25 '16

This always happens to me when I try dual booting.

→ More replies (6)

20

u/vwlsmssng Sep 25 '16

This is why I would always get the software engineers to distinguish between broken code and ugly code so we could get the release out.

23

u/luxliquidus Sep 25 '16

"Ugly code" is often just code that hasn't broken yet. It's technical debt, and someday it will come due.

2

u/vwlsmssng Sep 25 '16

I agree, technical debt is the seed of a useful concept that should be factored into the cost of the release. I never had time to find a suitable metric that could compare technical debt to the earnings to be made from the release.

15

u/zalo_111 Sep 25 '16

there's a hole in my bucket, dear Lois, dear Lois.

14

u/zpjack Sep 25 '16

And it all eventually leads to cooking meth in the Mojave

1

u/bigguyforyou Nov 15 '16

bb wasn't set near the mojave

12

u/nickiter Sep 25 '16

This is an amazingly accurate representation of a typical day working on a home renovation. I had to consciously force myself to stay on task because it's so easy to be like "Oh, I'll just do this quickly, and oh there's this thing here..."

11

u/iamseiko Sep 25 '16

That's what happens when you use Depth First Traversal.

9

u/[deleted] Sep 25 '16

As a programmer with ADHD this perfectly explains my daily life.

3

u/[deleted] Sep 25 '16

Thank God for Ritalin. I'm in a similar position to you, without it, not much would get done.

3

u/n1c0_ds Sep 26 '16

Unfortunately, they just won't recognize ADHD in Germany. No treatment for me.

2

u/[deleted] Sep 26 '16

Sorry you're dealing with that. I also do various therapies (learning how to organize things in a way that works for me... for example I always put my keys in the same place, no exceptions) try to get a good nights sleep and exercise. Still tough but manageable... hope you do well.

9

u/GregTheMad Sep 25 '16

99 errors and bugs in the code, 99 errors and bugs.

You take one down, you patch it around, 132 errors and bugs in the code.

4

u/mehmenmike Sep 25 '16

I like to call this gif "sidequests"

1

u/test822 Sep 25 '16

*checks watch* yep about time for this gif to hit r/all again

1

u/Jarmahent Sep 30 '16

Damn right

3

u/John_Fx Sep 25 '16

Ok. So we are doing this one again?

2

u/SmashedBug Sep 25 '16

Inb4 removed: rule 1. What a silly rule.

2

u/Nastapoka Sep 25 '16

slamming door noise

2

u/edsonmedina Sep 25 '16

Where's the youtube video?

1

u/dangshnizzle Sep 25 '16

One Small Favor anyone?

1

u/[deleted] Sep 25 '16

What movie is it from?

8

u/Nastapoka Sep 25 '16

It's from the show "Malcolm in the Middle"

1

u/solely_magnus Sep 25 '16

how did you make such a long gif?

1

u/roselan Sep 25 '16

That's the story of my life XD

1

u/osqq Sep 25 '16

It starts with something that seems very simple and stupid mistake, but suddenly there's just a black hole of failure

1

u/iDirtyDianaX Sep 25 '16

Fucking brilliant

1

u/[deleted] Sep 25 '16

The payoff was worth it.

1

u/simjanes2k Sep 25 '16

This is what it's like being a dad. Well, trying to be a good dad, anyway.

Wear a condom, kids.

1

u/Houdiniman111 Sep 25 '16

Seen this before in the same context. Describes it almost perfectly. It just doesn't show the part where you fix it slightly wrong and simply make a new bug, instead of finding a old one.

1

u/TotesMessenger Green security clearance Sep 25 '16

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)

1

u/cookiesponge Sep 25 '16

Is this how ADHD works?

1

u/SonOfTK421 Sep 25 '16

It doesn't matter what the context is when I see this, it always makes me laugh.

Except now a small part of me dies since my wife and I bought our first house two years ago. And it's all true. All of it.

1

u/Jonathan_the_Nerd Sep 25 '16

Should have used a queue instead of a stack.

1

u/tsoliman Sep 25 '16

Shamus Young had a good write up about this. He called it nested problems

1

u/FunkyNoodles Sep 26 '16

why you should use BFS instead of DFS

1

u/salgat Sep 26 '16

This is why I love unit tests. It's like having a dozen Hals on standby ready to test everything after you change something.

1

u/[deleted] Sep 26 '16

I love that she is incapable of changing it herself.

1

u/gogobebe2 Oct 30 '16

The end is what made me laugh :')

1

u/VaderD Sep 25 '16

This is epic!

-8

u/halborn Sep 25 '16

C'mon man. We see this posted often enough in every other subreddit already.

6

u/mellow_gecko Sep 25 '16

I must not be subscribed to any of those other subreddits. What were they?

6

u/halborn Sep 25 '16

Not counting this post, it has been posted in these subreddits (many of them multiple times):
/r/funny
/r/factorio
/r/feedthebeast
/r/SS13
/r/mistyfront
/r/TOMT
/r/gaming
/r/gifs
/r/ProgrammerHumor
/r/witcher
/r/analogygifs
/r/ADHDmeme
/r/linuxmemes
/r/jeepmemes
/r/shittyreactiongifs
/r/vim
/r/emacs
/r/me_irl
/r/OCD
/r/ethoslab
I could probably find more if I wanted to spend more than fifteen minutes proving the point.

13

u/mellow_gecko Sep 25 '16

This is literally the only one I'm subscribed to out of all those. Some seem worth checking out, thanks! By all means, keep proving the point.

0

u/halborn Sep 25 '16

That's weird. At least two of them are defaults. /u/Thromordyn

6

u/mellow_gecko Sep 25 '16

I'm not subscribed to many of the defaults, on account of them tending to be shit. But it looks like you might have found some decent ones there.

2

u/halborn Sep 25 '16

Honestly, that's a good policy to have.

3

u/[deleted] Sep 25 '16

How to start with reddit:

  1. Come up with a good username (optional)

  2. Register

  3. Ubsub from each and every default

  4. Sub stuff you like, as you come accross it.

  5. Browse some /r/all in the meantime, should you start with nothing. (Optional)

2

u/DipIntoTheBrocean Sep 25 '16

Many of us have unsubbed from many of the defaults. Personally, this subreddit is the only one I'm still subscribed to out of that whole list.

1

u/Deranged40 Sep 26 '16

First step on new account: unsubscribe from almost all defaults.

6

u/Thromordyn Sep 25 '16

Not subscribed to any of those subreddits, except this one, which I check regularly. Never seen it before.

0

u/[deleted] Sep 25 '16

what a naggy wife, this is why he started cooking meth.

-7

u/rupasix Sep 25 '16

r/factorio is leaking :D