A variable naming committee might seem exaggerated, but I've seen far too many variable/method/class names already that are wrong, misleading or at best misspelled, so some more thoughtfulness is definitely warranted...
Unfortunately, a lot of people who believe to be "thoughtful" have caused a lot of 20+ character names, which still need other names compounded on top, when they could have used 10 character names that explain things just fine.
The developers I met generally weren't that great at narrating themselves, regardless of seniority. Narrative skills are woefully undervalued, and they aren't solved by a set of hard, scientific rules just yet. I pray I'm a unique example in experiencing this, but I doubt it.
The bigger tragedy is the illogical need for programmers to come up with "elegant" names. A 20 character name doesn't do any damage if it communicates the correct point. Neither does a 10 character name that also communicates the same point.
Why does a developer favor the 10 character name over the 20 character name when both do the exact same thing? Is the goal to save memory? What is the point? There is no point.
It is a subconscious bias that makes programmers want to give things elegant names over clear names. There is no harm in creating a 40 character name that is ugly.
def find_xy_coordinate_of_dogs_cats_and_baboons_in_picture(picture: Picture) -> List[XYCoordinates]:
#there is NOTHING wrong with this function name.
It baffles me to no end why humans have a tendency to turn the above for no clear reason into:
def imgrecFindAnimal(p: Pict) -> List[vectxy]:
Beauty and elegance in code belongs in structure not naming. Clarity belongs in naming not structure (Golang is the antithesis of this). When both are unionized perfectly you get elegant code that does not sacrifice clarity.
A really good example of this is a function that encapsulates a complex regular expression. That regex is all but unreadable but you can embed an entire comment/description into the function name. Seriously write a grammatically correct sentence and make it a function name, there is no reason why this is bad... was there a more elegant name that you could have came up with??? Who cares. No harm done with your huge name other than burning the eyes of your inner OCD.
Except of course if you don't have auto complete. Then I can see how it's annoying for you to type out a whole sentence when you just want to call a function.
> A 20 character name doesn't do any damage if it communicates the correct point.
That depends on the context. If the function is the highest level task called infrequently (as in your example), then long highly descriptive names are completely fine.
If this occurs at every level, all the way down to the building blocks it absolutely, severely affects legibility of the entire code base - it is literally a multiplier of code size, in the worst case of "all the way down" it's some kind of power function.
This barely fits on a line:
(a leftmultipliedbyright (a leftsubtractedbyright 1)) leftdividedbyright 2
Yet it's a simple polynomial that should just be a(a-1)/2, probably part of a larger expression, now the other parts will end up on other lines (because no one writes 500 char width code), the effect is artificially spreading code thinly - this destroys locality and legibility.
You would be right to point out my example is extreme and absurd, however operators are functions, they only use different, implicit syntax. Many intrinsically complex pieces of code must create their own domain specific building blocks at a slightly higher level of abstraction that are much like operators, and this is the place for extremely short function names (think vector libraries), as such a commonly used building block it is unreasonable to expect each reference to fully and explicitly express the functions purpose.
As with all of these types of things, there is a balance, I am arguing _for_ balance, not suggesting all names should be single letter or single word - but that they have their place. However in my experience very long names are far more commonly due to thoughtlessness, they include excessive redundant context and at worst even grammatical words.
Bit late to the party but I really enjoyed this comment and the subsequent conversation. I was given some advice when I was junior and I've been repeating it for years.
Code it read 100 times more than it is written/edited. Writing in a high level language is writing for a human first and a computer second.
As a general rule of thumb a variable name should be as big as the scope of that variable.
* If it's scope is one line it's okay to use a single letter.
deletedDocuments = documents.find(d => d.deleted)
* If it's within a block normally one or two words will be fine.
* If it's one file, 3 or 4 words.
* If it's global it should read like the opening paragraph to war and peace.
The last two are generally indications that something has gone wrong with how you are encapsulating your code and you should consider a refactor. However you will often have no other option in which case always lean towards more descriptive not less.
I think it may boil down to highly respecting the readers' time. If something conveys the same information to them but is shorter, it will appropriate less of the precious limited time of their lives. Notably this then becomes a subtle balancing act of estimating their knowledge and intelligence: make it too short and some implied context may be lost and require extra effort to research from them. An extreme example is science papers - the same paper can be clear and concise for you if you are an expert in the domain (the usually assumed audience), or an overwhelming effort if you're not.
For programming, specifically, though, I feel the typical style used in programming straddles the line where the brevity hits a point of obscurity that actually leads to more time spent trying to decipher meaning.
I would say the time that is lost to deciphering meaning is much much more detrimental then time lost to parsing over-verbose words by a very large margin. Thus it's better to err on the side of longer names in programming until the verbosity is equal to the English language. I mean nobody complains about the English language being way too verbose, so why not bring programming up to the same level of clarity and verbosity?
That's an interesting argument. Personally, I don't think I agree, i.e. I feel very differently (though e.g. typical Haskell is an example of being too dense for me too). But I can't currently capture the feeling in more concrete words. That said, if we're both now speaking about what we feel, did I manage to at least succesfully counter your argument about this being illogical? ;)
One question came to my mind that I'm curious what's your take on, from the point of view you present: what's your opinion on notations such as: numbers (i.e. 123 vs. English language: hundred twenty three), and chemical formulas (e.g. H2O vs. English language: particle of water)?
>But I can't currently capture the feeling in more concrete words.
I mean if you want something more quantitative: Count the amount of posts in this thread that were communicated with a programming language as the primary mode of information transfer versus the amount of posts that used English instead.
Because the usage of Verbose and wordy English exceeds the usage of code one can conclude that people prefer the general wordy nature of English over the conciseness of code.
Due to this, it makes sense to make your code as close to verbosity as English as possible. I can read a novel or magazine almost passively, the same cannot be said of code.
>One question came to my mind that I'm curious what's your take on, from the point of view you present: what's your opinion on notations such as: numbers (i.e. 123 vs. English language: hundred twenty three), and chemical formulas (e.g. H2O vs. English language: particle of water)?
Whatever makes sense. 123 and one hundred and twenty three basically communicate the same thing. Humans as a whole prefer 123. There's no lapse in communication using either method. "One hundred and twenty three" takes a bit longer to read but no crime was committed. 123 doesn't lack any clarity for a typical human being either.
Perhaps I would prefer 123 as Arabic numerals are more universal globally then English.
For chemical formulas, H2O is used for balancing equations. It's specific notation for an algebra of using symbols to derive an exact conclusion, it is less a form of communication and more a system of symbols used for solving problems.
H2O, specifically, however, has culturally entered English nomenclature as a well known concept so it can be used in naming. There is however a slight potential for confusion so ultimate clarity makes more sense to me here. There is zero ambiguity with "particle of water" or even "H2O molecule" and thus my preference is to use English if the goal is communication.
The thing that you have trouble putting into words here is H20 is an elegant symbol that communicates the exact same concept then the uglier "particle of water." Humans are instinctively reacting to an aesthetic issue not a practical one. Again no crime is committed when someone uses the variable name "particle_of_water" in a programming language over "H2O."
I didn't go into it in other arguments but I will get into it here because you've noted to me that you have identified this "feeling" and you acknowledge the contradiction between English and coding.
The reason why the contradiction exists is purely an aesthetic issue. It's a response to what we consider categorically to be "ugly" and "beautiful" and has nothing to do with practicality. When viewed this way the contradiction between English and programming languages makes sense:
We define bad grammar in English as "ugly" but we also have a separate aesthetic sense for poetically naming things. This comes from beyond just programming. For example humans generally find "the White house" to be a better and more poetic name for "The place where the president of the United States" resides.
There's actually two separate modules in your brain here that are odds here. Bad english grammar is clearly triggering the language module in your brain, but at the same time your brain has a poetic naming module that prefers "The White house" over "presidents place of residence" and this module is being triggered when you program or write poetry. You can only begin to see this when I point out the logical contradiction.
Both of modules in your brain are bypassing the neocortex of the brain where people conduct higher order logic. It's actually very hard to realize this if it's not pointed out as people often mistake these feelings for being something that arose from their own internal higher order logic. The whole point of my writing take all of these modules in your brain and place them at odds so you can identify the origin of each and give your neocortex executive control. Anyway here are the three modules that are getting triggered:
- Bad english grammar triggers the language module in your brain.
- Verbose naming in code triggers the poetry module in your brain.
- The logical contradiction between the two modules above when identified through meta analysis triggers your neocortex.
Now that you know, you can step above it all. You can override instinctual your emotions and use your higher order logic to come to the correct conclusion.
To go a bit off on an tangent here there is in fact a morality module in your brain as well! What most people consider to be good and evil is actually instinctual emotions triggered by this module! Again similar to the main topic, most people don't realize this and believe their morality is built around logic when in actuality people are all just building a logical scaffold to justify a pre-existing instinct. Think about it... same with the whole whole poetic naming instinct we have, morality actually starts out as a feeling before we begin to logically justify it.
Believe it or not using the exact same method of pointing out logical contradictions I can actually prove to you that morality is in fact an instinctive module within your brain. It's off topic though, and I've digressed to much, so I won't get into that here.
No there's a difference. :) I made a point AND proved my point by showing a contradiction in human logic.
While I agree that the length of my argument made you not actually read it at all and miss the entire point, proving a point with illustrative examples does necessitate such verbosity.
What you're doing is stating a point without proving it and claiming that my own argument is self defeating with no explanation.
Why don't you try proving your point and also countering my proof while being concise at the same time? Because right now you just stated a point with nothing. You're stating in a single sentence the world is flat after I Proved it's round. Ok... So what? prove it.
They proved their point already. You took much longer and much fancier wording to say what could be said in a few lines, without losing any meaning. Verbosity for the sake of verbosity.
This is what I mean. Using long names compounds not only on itself. It compounds onto the entire codebase. Unless you blackbox the code, make it 100% bug free and it doesn't require changes for future features, that code will be read. Reading takes a lot of time, but worse: it takes far longer for someone to process a much larger cognitive load. This is especially dangerous in huge codebases that need to be changed on a regular basis, usually retorted by "it takes time to get in the swing of things".
We have better things to do in life. Respect the person who will read the code. Be concise.
In all my arguments I'm saying that this logic you present doesn't apply to English. Nothing was proven because my points weren't addressed.
You're not respecting my time with your grammatically correct comment above. You can shorten your comment by mangling the grammar and preserving the meaning.
>We have better things to do in life. Respect the person who will read the code. Be concise
See that sentence it's wasting my precious time you can get rid of a lot of unnecessary info and preserve meaning.
>We have better thing do. Respect reader. Be concise.
There. same point but more concise but now you sound as if you have brain damage. My point is we use programming languages and english to communicate a point, but clearly in english nobody takes any effort to respect anyone's time. It's full of wordy unnecessary stuff and the entire population of english speakers actually prefers reading this very verbose english then reading obscure code.
I am saying because of this contradiction all your logic flies out the door.
Bring the level of verbosity of code to the level of verbosity in english. We don't complain about english, we actually prefer it over code. So clearly nobody is actually caring about 'saving' those precious seconds of reading long grammatically correct sentences. Who cares if someone uses it as a function name.
It is redundant. It doesn't need the "xy_coordinate" because that is the return type. Furthermore it is wrong, it should be "xy_coordinates", with an "s". Or it shouldn't return a list.
The "in_picture" part is also redundant, it takes a Picture argument so why mention it?
Note: these arguments depend on whether you language supports polymorphism or not. In C for instance, you often have no choice.
The "dogs_cats_and_baboons" part is fine as long as it really is what you are looking for. If your intent is to find any animal and you implementation only finds dogs cats and baboons now, then you should call it "animals" with maybe a comment clarifying that point.
The problem with long fonction names is that they produce long lines. Long lines are terrible. Not as bad as they used to, thanks to large, wide screens but still, I hate having my editor window unnecessary large or have a horizontal scroll bar.
For maximum readability you want function names which are descriptive, but concise. My personal pet hate is when people make it concise by using acronyms and I’m just left wondering what the hell it stands for.
Personally, I find the ‘in_picture’ suffix superfluous as it’s clear from the input parameter what you’re finding the animal in, but otherwise find it a good name.
> My personal pet hate is when people make it concise by using acronyms and I’m just left wondering what the hell it stands for.
I agree. I can find, and understand reducePermissionLevel, but reducePermLvl is unguessable, and not searchable because abbreviations are arbitrary. Never abbreviating provides a predictable scheme.
i like clear and concise naming and don't care too much about how long it is generally if it helps understand what it does without being extraneously verbose. However, i think there is an argument to be made about how long a single line of code should be before it becomes too hard to read. The example given would be too long for me and i would try to shorten it. In this case probably by implementing some abstraction ;)
You claim there is an argument. But you don't actually state your argument.
My claim is that you think there is an argument, but there really isn't. That function name can do no real damage to the clarity or structure of the code. You only wish to shorten it because of OCD.
The logic here is easily illustrated if I rewrote that function name in English:
If my goal was to communicate this to you:
A function that finds the x y coordinates of dogs cats and baboons in a picture.
This is perfectly ok, but only because it's english. If I tried to write the English as if it was a function.
func xy_babboon_cat_dog_detector
The above doesn't fly in the English language. But it only works in programming. This is contradictory logic.
The question is, if both programming and English are both mediums used for communication why do they both have contradictory styles?
The reason is because there is no reason behind it. It's the same reason why people in Japan still use fax machines. Habit and typical human irrationality.
When you peel away the layers of your bias you will realize that this contradiction exists because the level of verbosity of my function doesn't actually matter. It doesn't matter in English, and therefore it doesn't really matter in programming.
Seriously, didn't you find it strange that you made your point without even stating what your argument was? Typically if you had a clear reason you would give it, if you had examples you would show it, instead you just said an argument existed probably never realizing what that argument actually was.
It's not just you. The other commentor just reiterated some points without trying to prove any argument. English has a preferred communication style that is contradictory to the preferred programming communication style even though both mediums can go back and forth between either style without any clear difference.
If you self reflect about it, your desire to make my function concise arises more from a feeling and a "emotion." You did not logically deduce your point using evidence... rather you just felt that it needed shortening and that it looks "ugly."
Then when I questioned that logic, your mind, without realizing it, began building a logical scaffold around the feeling to support the desire with some rational framework. Such is human nature, and this type of thing happens for all kinds of strange human biases that we posses. Religion, no doubt, is a similar bias... when questioned the religious persons' brain will go through the exact same process that your brain did upon seeing that ugly wordy function name.
The question is, by going meta and describing the situation in this way would that help you take a step up above that bias? Or will you continue to build that logical scaffold and try to justify your strange desire to make the function more concise for no reason?
Think about this before you reply... did you already honestly have an argument that justified your point? or are you building one right now to respond to me?
This is literally as close as I can get to what I'm talking about. There's this strange bias that every human (including me) has when they first learn programming to write concise "elegant" names for no real purpose. It's so strong that sometimes a normal argument can't help the other party reach an epiphany. Hopefully by going meta I can help better illustrate what I'm referring to.
>A function is a "thing", you should rather compare it to an entity in the English language.
It's more a verb that does an action on a noun. You can't express the concept with just a word.
add one to number
>Why do we say washing machine instead of a home appliance powered by electricity used to wash laundry through the use of centrifugal force?
Obviously there's no need to describe the plumbing behind the machine just the purpose of the machine is good enough. Everyone understands what a washing machine does as it's culturally a part of our language. If I lived in a civilization without washing machines and I had to implement it as a variable name in code I would call it "clothes_washing_machine" because of added clarity and no actual harm done with the extra word.
>When naming things you need to balance descriptiveness with conciseness, a name is not a definition.
Sure and I'm saying most people are wrong about where this "balance" actually lies. People place too much emphasis on conciseness.
>As a rule of thumb, avoid specifying things that can be easily guessed, especially if they are right there in your function signature (!):
I don't like readers to do any guessing at all. It's wrong to make assumptions that a guess that comes easily to me will come easily to my audience such is the nature of documentation and documentation as code. I want people to read my code like they read english. But that's just my opinion.
I mean what's the benefit of shortening this. I'm looking at this function and I'm feeling nothing happened. You just did extra work.
If I want to be nit, XYCoordinates should not be plural, List should contain many Types each called XYCoodinate. XYCoordinate(s) is better used as an alias for the entire list.
Additionally my function only operates on cats, dogs and baboons. It does not operate on all animals. Someone can mistakenly use this function to try to find lions and tigers and bears Oh my!
But that's besides my point. You attempted to shorten my function name while preserving meaning for which I totally understand the point you were trying to convey. What I'm saying is your changes are logically negligible. They do nothing to improve understanding of the program while trivially shortening things. Nothing practical occurred here. It's simply the scratching of an OCD need for more poetic names.
The argument is that at some point the length of the name is detrimental to readability, in the same way that a run-on sentence is detrimental to the readability of prose. I thought it was quite clear and your 16 paragraph response didn't touch on that at all. Or if you did, it was lost in the noise.
Oh I thought it was obvious that you don't want to rename a function after a 300 word paragraph. I didn't realize we need to get into that kind of semantics. My argument is that a sentence long function name of 10 words roughly is still a good function name. There's no hard rule here. Judgement is still qualitative The main point that I was arguing for is that this:
While I do like me some good meta-reasoning, at least I have an argument for shorter function names:
Short names are read in O(1) while longer are O(n) (unless the name can be simplified as “the function with the long name”)
Then you need to shorten your comment! Not as verbose as my replies but it can definitely use some improvement on the big Oh! Try this out for size:
> me like metareason, me have arg for short func name: Short name O(1), long are O(n) (some name too long: “the function with the long name”)
There's where your logic breaks down. If you truly followed the O(N) argument for all your communication mediums outside of programming you'd sound not so intelligent. Likely you built this argument as a response rather then actually followed it in both your English and programming communication styles.
my point is that i think there should be a soft limit on how long a single line of code should be because i feel like it becomes too hard to read if they get too long. that is an emotion as you said and it might be kinda arbitrary but i don't think there is something fundamentally wrong with it.
Sure there is a logical reason for why you don't want your function to be 4000 lines long. It gets unwieldy and becomes mechanically hard to manipulate or even understand the full meaning behind all 4000 lines. That's a logical argument. I completely agree with the soft limit.
There is no logical reasoning that can justify shortening this function yet the feeling is strong. That is the bias I am trying to illustrate. There is, in fact, nothing wrong with not shortening this function and keeping it as it is.
>This sounds like Hungarian notion taken to the extreme.
No it's sanity taken to the extreme.
Have you ever noticed that all things written to communicate things to people in the United States outside of programming is written in a very verbose manner using a language called English? It's used for technical manuals, text books, and stories.
Is English "hungarian notation taken to the extreme?" No dude. People actually find verbose English stuff easier to read. You don't have English writers abbreviating words and coming up with elegant acronyms in a physics text book.
>Why not write a comment if a paragraph is required to understand what you are doing.
I didn't say name your function after a paragraph. A functions English language analog is a word and at most a sentence. A paragraph would be several functions chained together. If you name your functions well, composed procedures will read close to an actual English paragraph.
That being said there's nothing wrong with comments, comment away but don't call your function doXYZ and put the entire description in the comment. Your comment doesn't follow the a function call.
Trust me, you may think your eyes are bleeding but they are not. The above is actually closer to the English language then 90% of code out there. What you don't realize is that there wasn't a need for a single comment and there wasn't a need to dive into any of these functions to read the definition. You just read the variable and function names and you know exactly what's going on. If you recompose these functions to do something else it's like recomposing sentences and words in the english language. The end result is still readable without the need for new comments.
When you read a recipe or follow directions to build something does the writer give you those directions in some coded nomenclature? No the writer writes verbose English with clear grammar. The point is clarity in naming in these entities, it makes zero sense why we don't do the same in programming.
>Writing a paragraph kills any formatting in vi/vim.
You know this might be a really different chain of thought that goes against the grain...
But maybe due to this lack of formatting in vi/vim makes vi/vim an extremely bad editor for programming? Seriously, humans are weird (Japan for example still uses fax machines). If it's so bad why do so many people use it? Maybe to look smart or maybe for the same nonsensical irrationality as to why we have to come up with some unreadable but "elegant" name for every programming primitive but at the same time we have to be extremely verbose for ALL other forms of written communication with English.
Programmers like to think they're smart and original. Most aren't... they follow the same tropes as every other programmer trying to come up with elegant names for no reason whatsoever and strangely unable to see the purposelessness behind this whole naming thing. If you can't come up with a good "name" for it, make the name an entire sentence, it's that simple... it's the reason why sentences exist.
"from_file", "by_name", etc. are fairly needless here. Most people are apt enough to grasp the first argument relates to the last word of the function name. Use properly named variables so a summary can take care of it, or only omit the noun, "get list of profiles from".
Get itself is a terrible prefix and could be omitted, especially if you keep "from". "list_of_profiles_from(X)" isn't any less clear. Alternatives like "read_list_of_profiles(file)" exist.
"List_of_profiles" can be changed to "profile list". You already did it with "concatenate_profile_lists", showing inconsistency. Alternatively, depending on the context, "list" itself can be omitted entirely, and just state "profiles".
"merge_married_profiles_into_list_of_pairs" can arguably be shorted to "merge_married_profiles" depending on IDE and language: that last bit should be clear from the returned value. Even without, it can still be shortened to "pair_married_profiles", as the context should make it obvious if we look for more than 1 married couple, there will be some kind of collection. Additionally, your naming has one problem: "merge_married_profiles". With all the verbose naming, it is still not clear what "married profile" is. I'll assume it means "pair profiles of married couples", where you might as well say "pair_profiles_of_married_couples".
>Programmers like to think they're smart and original.
It is because they think to be smart and original, they fall into the trap of overly verbose naming. Not from a lack of it. Have you looked at a legacy Java code base? Many of them can be slashed in half just by renaming variables to something that keeps the meaning, or draws meaning from the context very obviously. These guys are going against their own mind's natural ability to read context, or worse, conditioned themselves to learned helplessness.
You mean "being more conciseness is better if you don't have to sacrifice clarity for it"? Or just - "conciseness is a good thing"?
How would you rewrite that example, specifically, to make it more concise without sacrificing clarity, then? Do you mean to change the names without omitting type or relational information somehow? Or to omit some variables entirely in favor of nesting function calls?
If the latter, I don't see the relevance to that commenter's actual point about short vs long names; reducing the number of names is entirely tangential.
>Clear writing is about structure, not verbosity or repetition. Concise-and-clear is preferred over verbose-and-clear.
Except this is where the contradiction lies. In both well written literature and great text books... clarity trumps all even when conciseness is sacrificed. English is one of the most verbose languages out there. I can take your sentence and make it concise:
>My eye bleed.
>Writing about struct. No verbose or repeat. Short n' Clear beter den wordy n' Clear.
Is that better? Your misguided logic paints my concise version of your comment as "preferred" even though it has the exact same clarity. The stark reality is, for purely human reasons, people prefer the former example over the later and there is no real rationality behind it.
Try to think a bit outside of the box here. You share the biased and delusional opinion of a typical average programmer.
The real logic is, that the conciseness or verbosity is inconsequential. Our human nature allows us to prefer contradictory approaches in code vs. english because verbosity and conciseness doesn't actually matter that much. Clarity is king by a long shot hence the reason why most humans prefer reading literature over code.
My code displays the ultimate clarity. You insultingly claim that your eyes may be bleeding, but I guarantee you that unless you're mentally deficient, no part of my code was unclear. It was 100% obvious and crystal clear what my intentions are. The best part is, you only need to read it one time.
When is the last time in your life you've read a similar snippet of unfamiliar production code at first glance and left with the exact same level of clarity? Most similar production code needs a good number of guesses and hypothesis and a couple of reads and code following to develop the same level of clarity and confidence of understanding that my code can produce on a SINGLE reading.
I would wager we can agree on that point and if your claim otherwise I would wager that you are lying.
Programming is more like mathematical notation than english prose.
In mathematics we write a² + b² = c² to describe the relationship between the lengths of the sides of a right triangle. We don't write it out in english words longhand, because the notation is brief, packs a lot of meaning into a small amount of space, and lets our minds focus on larger concepts rather than parsing long phrases and keeping their meanings organized.
>In mathematics we write a² + b² = c² to describe the relationship between the lengths of the sides of a right triangle.
Therein lies the problem. Can you explain to me the meaning of a² + b² = c² without English? Can you just write down an equation and expect me to know what you're talking about?
Can you explain to me the concept of entropy by just showing me all the equations?
Can you explain to me the meaning of your program with only one letter variable names as shown in your Pythagorean equation above?
You can't. That's why math texts consist of equations AND English, and there's no reason programming shouldn't either.
Anyway a side note, have you ever heard of literate programming?
Why is matematical notation full of one-letter variables?
Cool when paper and ink is expensive and you're trying to send your proof to the other mathematician, in a letter in the mail, in the 16th century, but now? Why?!
Some of the highest value-to-effort feedback I've both given and received in a PR is about naming. Whenever I see something where my first impulse is to react with "WTF?!?" I now try to ask myself "does something here just have a bad name?" and much of the time that's all it is.
I was working on a financial trading program at one point, specifically a function to filter orders into bids and asks. They named the order value "total" and the order size "sum".
It made a really simple function incredibly difficult to read.
The developers I met generally weren't that great at narrating themselves, regardless of seniority. Narrative skills are woefully undervalued, and they aren't solved by a set of hard, scientific rules just yet. I pray I'm a unique example in experiencing this, but I doubt it.