3 ms·
map is already a short identifier and a real word This is heresy, but I actually think it might be better if it weren't a real word. I find I benefit from inv
by herdrick 16y ago
map is already a short identifier and a real word
This is heresy, but I actually think it might be better if it weren't a real word. I find I benefit from inventing names for functions or data abtractions. It helps to clear the mind of what those things might be.
Plus making map into mp or whatever makes it much more googleable. And don't get me started on Clojure having map and a Map.
- gruseom 16y agoConcur on both. It sounds like we're in the same tiny statistical bucket. :) By the way, there is a variant of "googleable" that I find to be a valuable property for names in a codebase, and that is "greppable". I try to make sure that the name of any important concept is a unique string in the program, so a simple grep will yield all the places it occurs. I'll even rename things that aren't as important, if their name includes this string, to preserve said uniqueness. (And no, the 'find usage' feature of IDEs doesn't come close to satisfying this need, since a concept can occur in many ways that don't yield to code analysis, such as comments.)
- gnaritas 16y agoI don't care if you invent words, if you call your function zork that's fine, it's still a pronounceable word. When I say real word, I mean it has consonants and vowels and is speakable. It's abbreviations that annoy me.
- herdrick 16y agoReally? OK, that's interesting. I guess I prefer speakable ones too.
- gruseom 16y agoAgreed all around. Whether or not a name sounds right when you say it is one of the criteria we use on our project for naming design ideas. If you're interested in the rationale behind this, Eric Evans' book Domain Driven Design articulates a concept of design as the "ubiquitous language" of a project that I have found very useful.