4 ms·
Well, yes and no. I can see your point, but simplicity and recognisability sometimes are sometimes a trump card. lst is actually a very good example. If you ar
by beobab 8y ago
Well, yes and no. I can see your point, but simplicity and recognisability sometimes are sometimes a trump card.
lst is actually a very good example. If you are writing small functions of less than a screen (which you arguably should be), and you can see that lst is a list of FileInfo, and the code to populate it in a function called GetAllWebConfigsUnderPath, and you have twenty of thirty other types of list generating functions, then seeing lst as the primary thing that gets filled everywhere is comforting and recognisable.
Having said that, having lstWebConfigs and lstAppleFiles and lstUnixFiles might be useful, for example.
Also, I assume you mean "type" as in "the kind of things that it is", rather than its actual type, such as integer, string, etc. lstInteger is largely pointless in this age of IDEs, but lstUserIdentifiers is demonstrably better (You shouldn't compare UserIdentifiers with StockCodeIdentifiers unless you work in H.R.)
- nimblegorilla 8y agoAbbreviating as lst is just bad. You saved one character. And now people have to guess whether you meant list, last, localString, or first.
- beobab 8y agoYeah, sorry. I misread the original "list" as "lst" because that's what's used extensively here, and you're right.
- jdmichal 8y agoWhen I said type, I meant type. Your example of "userIdentifiers" instead of "integers" is covered by my statement: "Your list (probably) holds a set of things that has a name. So name your list that."
- beobab 8y agoYes. I was agreeing with you in that bit. Sorry I didn't make it clearer.