Tagged Questions
2
votes
5answers
246 views
What's the dominant naming convention for variables in PHP: camelcase or underscores?
The consensus seems to be that one should follow the convention of the platform they're developing for. See:
Underscore or camelcase?
Naming conventions: camelCase versus underscore_case?
However, ...
3
votes
3answers
200 views
Is it correct to exclude argument names from function prototypes?
I was recently creating a small technical documentation for an application. The document is to be used by newly hired programmers to get acquainted with the application. It is much friendlier than the ...
32
votes
15answers
3k views
Is it bad practice to name an unused variable with a single underscore?
Often when the syntax of the language requires me to name a variable that is never used, I'll name it _.
In my mind, this reduces clutter and lets me focus on the meaningful variables in the code. I ...
8
votes
3answers
369 views
Should we rename overloaded methods?
Assume an interface containing these methods :
Car find(long id);
List<Car> find(String model);
Is it better to rename them like this?
Car findById(long id);
List findByModel(String ...
22
votes
9answers
862 views
Intentional misspellings to avoid reserved words
I often see code that include intentional misspellings of common words that for better or worse have become reserved words:
klass or clazz for class: Class clazz = ThisClass.class
kount for count in ...
