3 ms·
What is the convention used here for deciding the abbreviated names? It's clearly not removing vowels since prop has an o in it. So it becomes subjective as to
by invalidusernam3 8y ago
What is the convention used here for deciding the abbreviated names? It's clearly not removing vowels since prop has an o in it. So it becomes subjective as to how stuff should be abbreviated. If things are subjective, there is no standard.
In one function developer A might call it "rcvr", in another function developer B might call it "rec". Both mean "receiver", just use "receiver".
- deleted 8y ago[deleted]
- fro0116 8y agoExactly this. I take a hard stance against abbreviation in our team's codebases not solely because people might have trouble understanding what they mean (though when you take abbreviation to the extreme, i.e. words to single letters, that becomes a huge problem as well), but also because of the tendency for abbreviation to lead to an explosion in different slight variations of the same name used across the codebase to represent the same things, which increases the chances of missing important pieces in a refactor and decreases the chances of someone being able to find whatever they might be looking for. Keeping naming conventions consistent across a codebase with multiple people working on it is hard enough to begin with. Abbreviation makes it even harder. Definitely not worth the few keystrokes saved, imho.
- kiriakasis 8y agoFrom reading many blogs my intuition is that the standard is "four letter or less that sound kind of similar when read"...
- daotoad 8y ago`rcvr` is clearly Resistor Capacitor Viewer. Duh. And clearly `rec` is Recovery. The Story of Bunny Showers: I worked on a code base where we had, in one class, seemingly endless variations on the spelling of "business hours". There were variables named `bsns_hrs`, `business_hours`, ` business_hrs`. Furthermore, in the object's (horrible, messy, overlarge, mutable as fsck) internal state, there were elements labeled with `busnessHours`, `bsnsHours`, 'business-hours`, 'bnshrs`. And so on. My habbit when reading code like this is to map each spelling to a phonetically similar word or phrase. So `business_hrs` becomes "business hers" and `bnshrs` becomes "bunny showers". And so forth. It makes it easier to rationalize about what is happening, especially if, like me, you move your lips when you read. I have ever since called this issue of inconsistent spelling in code the "bunny showers" problem, owing both to the well-known fecundity of rabbits and the hellish proliferation of inconsistent names in that fabled codebase.
- chrismorgan 8y ago“Receiver” should doubtless be abbreviated to “rx” (common in telecommunications, along with “tx” for “transmitter”). (This has the added bonus of potential confusion with RxJS.)