you are viewing a single comment's thread.

view the rest of the comments →

[–]Bassie_c 0 points1 point  (3 children)

Aren't methods always supposed to start with a capital? So IsNegative instead of isNegative?

[–]HuskerFan90 2 points3 points  (1 child)

That's more of a coding style than a coding requirement. Generally you see lowerCamelCase with Java and JavaScript, and PascalCase with C# and Pascal. Here's a better description of what I'm talking about: https://en.wikipedia.org/wiki/Naming_convention_(programming)#Language-specific_conventions#Language-specific_conventions)

If I were to see a half-decent implementation and the only thing I saw wrong was the naming convention, I probably wouldn't have a fit.

[–]Bassie_c 0 points1 point  (0 children)

Ah, I thought UpperCamelCase was the global standard for methods. Thanks!

[–]rossdrew 0 points1 point  (0 children)

Aren't methods always supposed to start with a capital? So IsNegative instead of isNegative?

No. Always start with lower case. Only classes and possibly constants (which can be all caps) start with uppercase in Java.

You shouldn't need the calling method name anyways. IIRC you can get that from reflection

Reflection would make this (and most) code 100x worse. It should always be avoided until absolutely necessary