4 ms·
since there are two kinds of size (size | size_), i wonder if longer, more explicit, names would have helped prevent this bug.
by aaronblohowiak 15y ago
since there are two kinds of size (size | size_), i wonder if longer, more explicit, names would have helped prevent this bug.
- recursive 15y agosize_ is an amazingly terrible variable name, especially in a scope that also contains size. It's a little bit surprising to me that an open source project with node's visibility has code written that way.
- javajosh 15y agoWhat an odd belief, that quality of variable name selection scales with open-source project visibility! I would have thought it would scale with the judgement of active committers. Another odd belief is that criticizing a variable name that occurs fairly deep in the bowels of an open-source project that you are not actively involved with would carry any weight. Do you know what the code conventions are around this project? Whether the underscore has some agreed-upon significance? It's not that I'm against griping, I'm just against griping without sufficient context. It doesn't add to the conversation.
- recursive 15y agoNo, I do not know what the conventions are. But I do think that it's either a bad name or a bad convention. I submit as evidence that this mistake was made. I'm not always a good judge of what adds to a conversation, but here's another attempt: Projects that have good naming conventions are likely to have fewer bugs.
- bri3d 15y agoI think the grandparent's gripe is both valid and contributes to the conversation: it helps remind us that when people without institutional knowledge are encouraged to get up to speed and contribute to a project (i.e. the whole idea of "community open source"), verbose and logical variable names are valuable. Asserting that size_ is always an objectively terrible name is difficult, as yes, there might be some sort of convention around underscores. However, I have trouble disputing that verbose, plain-English, logical variable names help enhance code quality and reduce barriers to contribution. I'd certainly feel much more comfortable getting up to speed with and contributing to a code base which used more verbose and logical names than say, size_.
- aaronblohowiak 15y ago> I have trouble disputing that verbose, plain-English, logical variable names help enhance code quality and reduce barriers to contribution This was the entirety of my point, but said more articulately.