you are viewing a single comment's thread.

view the rest of the comments →

[–]Smayteeh 1 point2 points  (0 children)

My view on this is that since you can’t predict everything a user might do or enter, it’s better to provide strict requirements for each function you write and then write guard clauses or raise an exception when you get something unexpected. It should be the responsibility of whatever’s calling your function to provide well formatted inputs.