3 ms·
Descriptive function names - yes, of course. With one function call per line. But long variable names?!? There is no place for such an abomination under this s
by sklogic 10y ago
Descriptive function names - yes, of course. With one function call per line.
But long variable names?!? There is no place for such an abomination under this sun.
- kiruwa 10y agoIncluding class variables? Their context is far larger than the immediate code you're looking at, longer/descriptive names seem basically required there, as they have essentially similar scope to functions. (Same logic applies to making them longer) You'll note... that was my original example.
- sklogic 10y ago> Including class variables? You mean field names? A paradigm where you have such a thing is _awful_. Seriously. And this is exactly one of the reasons why it is awful and why it leads to an unreadable and unmaintainable code.
- kiruwa 10y agoAre we anti-OOP then? And no, I don't believe you. Making your variable names more descriptive does not make your code less readable. Even when it's not strictly necessary, it's not harmful to comprehension UNLESS you refuse to move from a completely outdated line width. Some people argue that it takes longer to type and edit. But as we all know, we spend far more time reading than writing code, and modern editors (like vim!) have solved this non-problem anyways.
- int_19h 10y agoLong variable names are great. When used in conjunction with redundant variables for intermediate computation results (effectively naming those results), they can make a terse but complex expression much easier to read and understand, to the point where something that required a comment no longer does so.