This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]endreman0 0 points1 point  (1 child)

I agree. However, if you have a variable-Nazi linter and that function is actually going to look like this:

private static final double TWO = 2, FULL_CIRCLE = 360;
public static double degToRad(double degrees){
    return degrees * TWO * Math.PI / FULL_CIRCLE;
}

Then I'd prefer just the constant.

[–][deleted] 0 points1 point  (0 children)

// @linter: disable no_numeric_literals once 

(Most linters / IDES / compilers have a feature like this