I'll share one reason: long variable names can obscure the shape of otherwise concise code. When this happens, they occlude information at the whole-program or whole-function level, even as they add information at the variable level.
The pushback always seems to be about how long names look, never about the cost of misreading short ones. I'll take some extra verbosity over having to guess every single time.
Tyre thickness should not appear in the formula of wheel diameter though... Also it would be better to include the unit in the names of non dimensionless values.
> I'll be honest with you, dear reader: I couldn't figure out the meanings of these variables by thinking through it on my own, nor by flipping through the book's pages. I had to go and ask Claude.
this is definitely learned helplessness. You do _not_ need claude to read a few lines of context and figure this out.
class Wheel
def diameter
rim + (tire * 2)
end
end
If you know what a diameter is, then this snippet contains all the information you need to understand what `rim` and `tire` most likely are; the missing information is units but those appear to be out of scope in this book example.
Some people call it slop, although a more professional framing would be to call it high variance ambiguous language. Don’t even get me started on jargon, like referring to things as “surfaces” instead of what they are (react components, pages on a website, etc)
I like it.
I like even better that be able to Call Things What They Are, you must first Know What They Are.
And if you have figured that out, you are close to being able to explain Why Things Are What They Are.
This is just "long variable names are good" which for some reason gets a lot of pushback.
> which for some reason gets a lot of pushback
I'll share one reason: long variable names can obscure the shape of otherwise concise code. When this happens, they occlude information at the whole-program or whole-function level, even as they add information at the variable level.
Claude in particular seems pretty resistant to it. Renaming its variables to something I understand is half of my code reviews sometimes.
The pushback always seems to be about how long names look, never about the cost of misreading short ones. I'll take some extra verbosity over having to guess every single time.
Tyre thickness should not appear in the formula of wheel diameter though... Also it would be better to include the unit in the names of non dimensionless values.
Right.. it's almost like the programmer would be helped by knowing what type of "messages" the object in hand accepts.
One of the many problems with POODR.
I agree here, but c'mon...
> I'll be honest with you, dear reader: I couldn't figure out the meanings of these variables by thinking through it on my own, nor by flipping through the book's pages. I had to go and ask Claude.
this is definitely learned helplessness. You do _not_ need claude to read a few lines of context and figure this out.
If you know what a diameter is, then this snippet contains all the information you need to understand what `rim` and `tire` most likely are; the missing information is units but those appear to be out of scope in this book example.Some people call it slop, although a more professional framing would be to call it high variance ambiguous language. Don’t even get me started on jargon, like referring to things as “surfaces” instead of what they are (react components, pages on a website, etc)
I would propose an alternative, Call Things What They're Like.