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.
For example this code will make an error box and interrupt users.
function getDomainFromURL(url) {
assertTrue(url, 'URL should not be null');
...parsing
}
So, I'd make like this.
function getDomainFromURL(url) {
if (!url) return;
...parsing
}
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 assert disappear on production code.
Question 1 Do you think so? Or have any different idea?
Question 2 If you think so, is there any good way to do it with Spring3 framework?