When is a function name too long?

后端 未结 27 1526
伪装坚强ぢ
伪装坚强ぢ 2021-02-03 18:45

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 \"GetActionFr

27条回答
  •  清酒与你
    2021-02-03 18:53

    The function name is too long when it would save you work to use a shorter one.

    The reason we usually go for descriptive function names is because it saves us work. (by making it easier to understand and maintain the code). So it logically follows that you should not give your functions names that are so long that it costs you extra time (making the code harder to read, for example)

提交回复
热议问题