Be careful about chaining conditions
This may dangerous, because it's harder to debug.
For example:
If we broke it down to multiple if
conditions it makes it easier to debug.
Pros for using multiple conditions:
If you use
Exception
s instead ofreturn
statements, you can easily get a stack trace which is extremly useful.Easier usage of
print
style debugging.
Cons for using multiple if
conditions:
Longer function statements.
Last updated