1
vote
3answers
273 views

How to shorten the case statement from hades? [duplicate]

I'm refactoring code and have reached a horribly gigantic switch statement. Every single API method available to end users is represented as an enum and we have a switch statement iterating over the ...
1
vote
1answer
140 views

Validating data to nest if or not within try and catch

I am validating data, in this case I want one of three ints. I am asking this question, as it is the fundamental principle I'm interested in. This is a basic example, but I am developing best ...
6
votes
2answers
721 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 ...
5
votes
4answers
714 views

Differences in If… Else… statement

When I first started to learn programming I remember having an argument with my teacher about If Else statements. I was arguing that: if { ... } else if { ... } ... is basically the ...