2 ms·
It's also pretty easy to have a one-letter convention for type-obvious situations. For example, if I name a variable s, f, i, or n, then I always know that it's
by mistercow 14y ago
It's also pretty easy to have a one-letter convention for type-obvious situations. For example, if I name a variable s, f, i, or n, then I always know that it's a string, float, integer or integer, respectively. Beyond type information, I also always know that "n" is going convey the notion of a count.
Obviously again this is only reasonable if you only need to know type information, but if you're writing a function like
repeatString = (s, n) -> (s for i in [0...n]).join ''
then it's completely pointless to give those more verbose names. You wouldn't actually be conveying additional information until you got to an utterly ridiculous point like
repeatString = (stringThatWillBeRepeated, numberOfTimesToRepeatTheString) -> (stringThatWillBeRepeated for i in [0...numberOfTimesToRepeatTheString]).join ''