4
votes
4answers
308 views

Choosing value in SQL query vs (Java) code

I need to choose one of three values of an integer using the value of a column on a nullable column of a table. There are at least two approaches: 1) use SQL to do all the work: test null values, and ...
2
votes
2answers
348 views

“Clean Code”: How to organize named queries?

Few days ago I started to read Robert C. Martin "Clean Code" book and it encouraged me to look more detailed at my code. After I opened eclipse I saw this: ...
3
votes
3answers
589 views

Ordering if conditions for efficiency and clean code [closed]

This is purely a design question and the example is simple to illustrate what I am asking and there are too many permutations of more complex code to provide examples that would cover the topic. I am ...
1
vote
1answer
137 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 ...
1
vote
1answer
123 views

Writing arguments in constructors

When creating constructors with multiple arguments, is ok to use the generic String[] args or is it better to list the arguments? Does it really make any significant difference as the coding becomes ...
1
vote
2answers
83 views

Whether to separate out methods or not

I am new to java and want to learn best coding practices and understand why one method is better than another, in terms of efficiency and as the coding becomes more complicated. This is just an ...
3
votes
4answers
479 views

Casual projects on Github omit error checking, logging, etc., for the sake of clarity?

I just started using GitHub to socialize some projects for simple chat and peer-to-peer apps. With respect to coding, is it customary to omit exception handling, error checking, logging, etc., to ...
5
votes
2answers
809 views

Constant values in the interface

Some time ago I have read two different books and each of them gives totally different answer for the question if it is a good pattern to define constant values in the interface (in java). So I am ...
2
votes
3answers
321 views

Where should I include comments in my “self-documenting code”?

I'm currently developing a web-app by myself and have made it a point to use descriptive variable and method names (sometimes at the expense of brevity) in order to minimize commenting. The plan was ...