Click here to Skip to main content
15,890,512 members

Survey Results

How important is naming to you in your code?

Survey period: 23 May 2022 to 30 May 2022

There are 2 hard problems in Computer Science: caching, naming and off-by-one errors

OptionVotes% 
I am obsessive and consumed with getting naming right657.80
I am very, very careful with naming23227.85
I do my best, but try not to over-think thiings46956.30
I don't really give it too much thought. Whatever name pops into my head is fine384.56
I really don't care. 26 letters in the alphabet, 26 names, right?40.48
I'm deliberately malicious, obfuscating, and / or sarcastic with my naming50.60
I don't understand what this "naming" thing refers to.202.40



 
GeneralRe: "try not to overthink thiings" ... with ii ... Pin
trønderen24-May-22 1:51
trønderen24-May-22 1:51 
GeneralRe: "try not to overthink thiings" ... with ii ... Pin
Bernhard Hiller24-May-22 21:34
Bernhard Hiller24-May-22 21:34 
GeneralRe: "try not to overthink thiings" ... with ii ... Pin
Gary R. Wheeler26-May-22 11:10
Gary R. Wheeler26-May-22 11:10 
GeneralCaching........ Don't right now. Pin
Ron Anders23-May-22 2:59
Ron Anders23-May-22 2:59 
GeneralI am careful with naming, though often clash with existing conventions Pin
den2k8822-May-22 23:49
professionalden2k8822-May-22 23:49 
GeneralCareful with naming - Always descriptive Pin
Slacker00722-May-22 22:04
professionalSlacker00722-May-22 22:04 
GeneralRe: Careful with naming - Always descriptive Pin
CHill6022-May-22 23:29
mveCHill6022-May-22 23:29 
GeneralRe: Careful with naming - Always descriptive Pin
trønderen24-May-22 0:19
trønderen24-May-22 0:19 
Some programmers are unable to control themselves, thinking that "Longer is better - unconditionally and always!"

So they consider the variable name 'Price_paid_for_the_product' to be far better than 'Price'. To turn on that visual signal labeled 'LED1' on the circuit board, they insist to program 'Light_emitting_diode_one = On' rather than 'LED1 = On'.

I was in a project at a time when the company programming style standards were revised. Our project leader granted an exception from one of the coding rules: No statement longer than 80 characters. The problem was that the project naming rules frequently lead to names exceeding 80 characters. I never thought that those names improved readability.

In other projects, I have implemented protocol standards where the standard defines a set of states and a set of events identified by abbreviations / acronyms of 3-5 characters, predicates identified as p01 to p67. When you make a direct implementation of this standard, it would be silly to attempt to de-abbreviate or de-acronymize state and event names and make up some strange, unknown 'descriptive' name for the predicates, in order to 'improve the readability' of the code. It strongly distorts the reading of the code.

I have similar problems with papers and articles that seem to think that the reader (presumably a professional, or at least semi so) is completely unfamiliar with basic, well established terms. So throughout the text, they write e.g. 'CPU (Central Processing Unit)' and 'DMA (Direct Memory Access)' and 'RAM (Random Access Memory)' - not only when the term is introduced, but throughout! I get the feeling that these people would write 'VB6 (Visual Beginners All-purpose Symbolic Image Code Version 6)' on every reference to VB6 as well ...

So please: Use common sense. When 'readability' has reached the level of 'no ambiguity whatsoever', there is no need to use a phrase rather than a name to refer to a variable, value or object.
GeneralRe: Careful with naming - Always descriptive Pin
JP Reyes24-May-22 6:34
JP Reyes24-May-22 6:34 
GeneralOutdated options PinPopular
lmoelleb22-May-22 21:08
lmoelleb22-May-22 21:08 
GeneralMany more hard problems Pin
Patrick Van Cauteren22-May-22 21:50
Patrick Van Cauteren22-May-22 21:50 
GeneralRe: Many more hard problems Pin
Gary R. Wheeler23-May-22 14:22
Gary R. Wheeler23-May-22 14:22 
GeneralRe: Many more hard problems Pin
lmoelleb23-May-22 20:43
lmoelleb23-May-22 20:43 
GeneralRe: Many more hard problems Pin
trønderen24-May-22 0:59
trønderen24-May-22 0:59 
GeneralRe: Many more hard problems Pin
Julian Ragan24-May-22 8:45
Julian Ragan24-May-22 8:45 
GeneralRe: Many more hard problems Pin
Cpichols24-May-22 1:17
Cpichols24-May-22 1:17 
GeneralRe: Many more hard problems Pin
k505425-May-22 3:20
mvek505425-May-22 3:20 
General3 problems listed Pin
Shao Voon Wong22-May-22 20:43
mvaShao Voon Wong22-May-22 20:43 
GeneralRe: 3 problems listed Pin
den2k8822-May-22 23:46
professionalden2k8822-May-22 23:46 
GeneralRe: 3 problems listed PinPopular
Daniel Pfeffer23-May-22 0:57
professionalDaniel Pfeffer23-May-22 0:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.