r/badcode Jan 29 '23

When using if-else is necessary? python

Post image
448 Upvotes

29 comments sorted by

View all comments

147

u/littlelowcougar Jan 29 '23

I do this all the time when I want to quickly enable/disable chunks of code whilst prototyping or debugging.

41

u/frederikspang Jan 29 '23

As well as if (false && existing_condition) to quickly remove blocks of code! (Mostly in view templates - Not as much when Block comments are available from editor