«« Next » « Previous
«« Next » « Previous

Link Details

Link 93245 thumbnail
User 241715 avatar

By dlinsin
via dlinsin.blogspot.com
Submitted: Jul 08 2008 / 00:12

In a previous post I'm suggesting to properly document your API, in particular constraints of method arguments. Users of your API should know what they can safely pass to methods and what needs to be checked upfront. Documentation is good, but how do you know that your users gonna read it or adhere to it? Well, you don't! That's the reason why you shouldn't trust users and stick to a defensive programming style. In order to prevent faulty injection and to fail fast, you should check every argument according to the specs, defined in the javadocs.
  • 2
  • 0
  • 64
  • 8

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)



Voters Against This Link (0)