24

That feeling when you're supposed to debug code someone else wrote a decade ago but it's such a horrible mess that your brain just gives up and you end up staring at your monitor for an hour in confusion 😵

Comments
  • 2
    I was once in the same situation, but then my boss allowed me to rewrite the part and this was much quicker than to debug the code.
  • 1
    Yep. Need to rewrite. It's faster and safer.
  • 0
    @siggi Yup, I'm definitely going to do that when I get back to it after the weekend.
  • 2
    That feeling when you suddenly realize that it was your code all along...
  • 0
    @TobiSGD I won't lie, that has happened too 😅
  • 0
    @TobiSGD That‘s why I always use git blame before shouting „Who wrote this piece of crap you morons“ ;)
  • 0
    @irene There are multiple options of course, all implementing git blame(last change).
    You could do something like git blame -L 5 index.php to see who changed line 5 in index.php the last time but that‘s annoying of course so I normally use my IDE for that.

    At work we currently have to use phpstorm(Doing web dev atm since team needs support). There you just do a right click on the line number->annotate and there you go.
  • 0
    @irene ok then I misunderstood you, sorry.
    Well, I work on many projects at the same time with multiple teams and sometimes I realize that it‘s my code but it doesn‘t look exactly like it should be. Then git blame helps to see what line was changed by whom and when.
Add Comment