title: Assertive programming with JavaScript
body: <p>I know why assertive programming is good, so I want to use it with JavaScript. However, I don't want to show users error boxes, and it's unusual thing. Just ignore it and make them retry could be better. </p>
  
  <p>For example this code will make an error box and interrupt users.</p>
  
  <pre><code>function getDomainFromURL(url) {
      assertTrue(url, 'URL should not be null');
  
      ...parsing
  }
  </code></pre>
  
  <p>So, I'd make like this.</p>
  
  <pre><code>function getDomainFromURL(url) {
      if (!url) return;
  
      ...parsing
  }
  </code></pre>
  
  <p>Second one is good for usability, I think, and first one is good for developing.
  Therefore, IMO it would be the best to combine these and make the <code>assert</code> disappear on production code. </p>
  
  <p><em>Question 1</em>
  Do you think so? Or have any different idea?</p>
  
  <p><em>Question 2</em>
  If you think so, is there any good way to do it with Spring3 framework?</p>