16
biglars
5y

When you have to write methods that can only be used in a specific way only just to make sure your coworkers aren't fucking shit up.

Comments
  • 1
    Done that.. not proud of it but my coworkers were idiots.
  • 4
    Generally called "defensive programming", and in most cases it's a *good* habit to get into IMHO. Code that throws exceptions early when it's called in the wrong context can save you a lot of hassle later.
  • 2
    I think this is the only good way to code in projects with multiple people in them. You always have to assume an idiot is going to use your code, thats why you should give everything clear naming, simple usage, check inputs with early failing and *helpful* error messages that can help identify and fix the problem, that goes twice for any tests you write
Add Comment