2
votes
1answer
138 views

Naming test methods in Java [closed]

Over at codereview a comment hinted that using snake_case to name test methods is a good idea. This contradicted my views and I did some research and there seem to be a lot of examples that actually ...
0
votes
1answer
103 views

What is ServletUtilities?

The answer in this question suggests creating a ServletUtilities class to handle text conversion between Java strings and XML text. Generally when you create a JEE web application you put ...
6
votes
2answers
722 views

Java convention for if/else if order

I have an if/else if structure that on some cases does nothing. From the code I have seen in my career, the "empty" case is normally left out. But when I wrote my code, it just doesn't feel right to ...
25
votes
4answers
10k views

Is it better to use assert or IllegalArgumentException for required method parameters?

In Java, which is more highly recommended, and why? Both types will throw exceptions, so in that regard handling them is the same. assert is slightly shorter, but I'm not sure how much that matters. ...