4 ms·
English is not my native language, and it took some time for me to actually parse those short variable names you provided as examples. Though, I still don't kno
by milansm 10y ago
English is not my native language, and it took some time for me to actually parse those short variable names you provided as examples. Though, I still don't know what propCnt is supposed to mean. But even if I did, it takes some cognitive effort to parse shortened names. I think that's the case with native speakers as well, but it's more noticeable at non-natives because the time interval is longer. IMO those little parsing efforts add up and are tiresome if you have to do it all day long. Imagine if the books are written that way.
- kosievdmerwe 10y agoYou're not taking something into account with the shortened names: they are common and have consistent meaning. So after a few exposures it becomes trivial to read.
- greenhatman 10y agoI find it frustrating. Why not make it trivial to read the first time? I didn't get that intvl was interval until I read the reply. Why not just write interval or propertyCount? It doesn't make it much longer, and it's much easier to read. Long names only becomes a problem when you're concatenating more than three words for one variable. And that's really the problem, the number of words in a variable, not its character lenght.
- jstimpfle 10y agoYou can answer it yourself, but here goes: Because the trivial investment you have to make to learn these ubiquitous abbreviations might (no general judgement made) be outweighed by the benefit of better readability once you made that investment. "propertyCount" is 6 characters longer than "propCnt". In arithmetic expressions this can easily amount to 12 or 18 characters saved. I suggest you point out a specific example and show how you would do it in a better way.
- andreareina 10y agoI suspect it's supposed to be popCnt (no "r"), which is short for "population count", which is the number of set bits in a byte/short/int/long/what-have-you.
- userbinator 10y ago"prop" is a common abbreviation for "property".
- janekm 10y agoKind of a perfect example of the ambiguity in over-shortened names ;) I also read it as propertyCount (which in my style shouldn't even be a variable...)
- masklinn 10y agoThat one specifically strikes me as a counter-example if anything, you don't lose anything by adding two more characters and calling it popCount, and it's significantly easier to read and understand.