Skip to main content
7 events
when toggle format what by license comment
Apr 24, 2018 at 6:47 comment added Ewan because its a local variable, (which it needs to be in the context of the answer) unless you copy and paste there is no benefit to the more generic name. If you have 10 getModelbySomethingAndSomething getAllDifferentModel etc etc then the generic name saves you renaming (and thinking up 10 non generic names)
Apr 24, 2018 at 0:19 comment added rwong I guess the point is that, the one-sentence mentioning of "copy and past (sic)" seems to distract (or even ruin) an otherwise good answer. I would rephrase your answer in this way: for small functions, the function name already provides some context; function arguments can use a little bit of extra naming juice (for context) if that helps further reduce confusion, or to promote consistency (uniformity, pattern) in the user's brain. In a small function like this, bikeshedding about local variable name is nobody's business. Functions longer than 10 lines of code need written more carefully.
Apr 23, 2018 at 19:09 comment added Ewan copy and paste with minor changes is sometimes better than making things super generic
Apr 23, 2018 at 19:02 comment added Frank Hileman I would say all repositories are bad, but it was about variables. Your point in the answer is correct, I just would not promote copy and paste.
Apr 23, 2018 at 16:30 comment added Ewan generic repos are bad
Apr 23, 2018 at 16:24 comment added Frank Hileman Copy and paste? You made the code general via the names and design. Go all out and make it completely reusable via generics and/or delegates. I imagine you would do this, but you did say "copy and paste".
Apr 23, 2018 at 14:49 history answered Ewan CC BY-SA 3.0