My coworker in Austin looked at my 40 line function and asked why I wrote a novel
Last Tuesday I showed my function to this guy on my team, he has been coding for maybe 2 years. He scrolled through my nested if statements for about 10 seconds and then just asked why I wrote a novel instead of a summary. I had 4 levels of if/else and did not even notice how deep it went until he said that. So I broke it into small named chunks and the whole thing got way easier to read. How do you all catch yourself before a function gets that ugly, or do you just wait for someone to call it out?