Relative Content

Tag Archive for variables

What are the pros and cons of temporary variables vs multiple returns [duplicate]

This question already has answers here: Where did the notion of “one return only” come from? (14 answers) Closed 11 years ago. Take the following examples: public static String returnOnce() { String resultString = null; if (someCondition) { resultString = “condition is true”; } else { resultString = “condition is false”; } return resultString; } […]

What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)

I take a good deal of criticism from other programmers due to my use of full proper casing for all my variables. For example, your typical programmer will use employeeCount for a variable name, but I use EmployeeCount. I use full proper casing for everything, be it a void method, return method, variable, property, or constant. I even follow this convention in Javascript. That last one really rustles people’s jimmies.

What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)

I take a good deal of criticism from other programmers due to my use of full proper casing for all my variables. For example, your typical programmer will use employeeCount for a variable name, but I use EmployeeCount. I use full proper casing for everything, be it a void method, return method, variable, property, or constant. I even follow this convention in Javascript. That last one really rustles people’s jimmies.