1

Opinions on taking initiative and the expression of "easier to ask for forgiveness than for permission", when are the use cases, is it just a way to try and squeeze more work out of people in the Hope's they move fast and make cool minimum viable prototypes and stuff? Is it pointless until you have the skillz to do it properly/well?

Comments
  • 0
    This is a Python motto for using exception handling instead of testing beforehand if anything you want to do will work.
    For example, if you say print(i/j), this will crash if j == 0. You could surround it with: if j != 0: ...
    But now, Python tests twice whether j == 0 or not: you wrote an explicit test for it, and Python will test again when evaluating i/j, to see if it needs to throw that ZeroDivisionError into your face. This is a waste of time, and is called "asking for permission".
    The Python way is to write:
    try:
    print(i/j)
    except Exception:
    print("oops")
    So you just go ahead, and bear the consequences if anything goes wrong. This is the "asking for forgiveness" part of the expression. :-)
Add Comment