函数名称何时过长? [英] When is a function name too long?

查看:138
本文介绍了函数名称何时过长?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在可能的情况下,我会尽量用函数名进行描述.这有时会导致函数名称在20到30个字符范围内,例如"GetActionFromTypeName"或"GetSelectedActionType".在什么时候函数会变得太费时间(对于编译器来说不会太长)?

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)?

推荐答案

如果有一种简短但描述性的函数命名方法,则函数名称太长.

If there's a shorter, but yet descriptive way to name the function, then the function name is too long.

这篇关于函数名称何时过长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆