T
28

That dude in the Python subreddit told me to stop using 'else' and it blew my mind

Some random guy named Chris replied to my beginner code saying 'else is a crutch' and showed me how to handle conditions with early returns instead. Took me 3 rewrites to get it, but now my if statements make way more sense. Anyone else have a comment that totally flipped how you write something?
2 comments

Log in to join the discussion

Log In
2 Comments
simon_chen
simon_chen12d ago
Bro my buddy sam had some guy tell him "stop using classes for everything" and he straight up rewrote his whole project in a weekend.
2
charles_henderson
Man I had a buddy named Dave who did something similar... he was making a little game in Python and some guy in a discord server told him "functions only" and Dave spent a whole Saturday ripping everything apart. Now he's got like 400 helper functions and the code is somehow even harder to follow than before. @simon_chen your buddy Sam at least commited to it, Dave just got annoyed halfway through and left a bunch of broken references everywhere.
7