I try to be rather descriptive with my function names, where possible. This occasionally results in function names in the twenty to thirty character range such as "GetActionFromTypeName" or "GetSelectedActionType". At what point do functions get too long to manage (not too long for the compiler)?
相关问题
- Name for a method that has only side effects
- Best way to keep the user-interface up-to-date?
- should I write more descriptive function names or
- Open a new tab in firefox and keep ff in the backg
- How do I write a function to compare and rank many
相关文章
- Should client-server code be written in one “proje
- Algorithm for maximizing coverage of rectangular a
- Is there an existing solution for these particular
- Should I keep bad naming conventions?
- What is Scope Creep? [closed]
- How can I modify .xfdl files? (Update #1)
- F# naming convention
- coding style checker for c (variable names, not in
As long as the functions actually do what their name suggest they do and you're not going for a code golf entry, I think it's a good thing.
I think that this is especially important for public names - they should not be too long, but how long too long is is very subjective. Always have better a longer and descriptive name than a too short name.
For private methods even very long names are really no problem in my opinion.
I don't think a method name can be too long as long as it is descriptive. If a method name goes over 40 characters I will see if I can convey the same meaning in fewer words. If not I'll live with the long name in for the sake of clarity.