这个命名约定是什么?
我正在查看来自多个开发人员的具有多种命名约定的代码 - 真是一种享受。其中包括匈牙利语(“s_year”,“s_day”)以及其他风格(“yearS”,“dayS”)。
有谁知道这种风格叫什么?对于奖励积分,您知道它起源于何处/何时?
免责声明:奖励积分是假设的,仅根据每个请求授予。请给予 5-12 周的交货时间。
编辑:我想补充一点,同一个文件中有第三个符号(“sYear”,“sDay”)。这是命名约定的帽子戏法!
I am looking through code that has multiple naming conventions from multiple developers - a real treat. Amongst them are Hungarian ("s_year", "s_day") as well as this other style ("yearS", "dayS").
Does anyone know what this style is called? For bonus points, do you know where/when it originated?
Disclaimer: Bonus points are hypothetical and awarded on a per-request basis only. Please give 5-12 weeks for delivery.
Edit: I would like to add that there is a third notation ("sYear", "sDay") in the same file. It's the hat trick of naming conventions!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是没有命名约定或经常更改命名约定的完美示例。不幸的是,我已经看到很多这样的情况了。
This is an perfect example of either no naming convention, or of a frequently changed naming convention. Unfortunately, I have seen this quite a lot.
它被称为“脑白质切除记法”。它是由 RP McMurphy 发明的。
It is called "lobotomized notation". It was invented by R. P. McMurphy.
它很可能根本不是一个符号 - 通常[懒惰]程序员需要一个唯一的变量,其中类似的变量已经在范围内 - 因此他们需要另一个“年”的持有者,并且“年”已经被采用了,所以他们选择了“yearS”。如果它有任何符号的话,那就是在它的好色中脱颖而出,以提醒您将其更改为将来有意义的东西(这从未实现过。哇哈哈哈哈哈!)
It's likely it's not a notation at all - quite often [lazy] programmers will have a need for a unique variable where a similar one is already in scope - hence they needed another holder for a 'year' and 'year' was already taken so they opted for 'yearS'. If it's any notation at all, it would be to stand out in its blecherousness as a reminder to change it to something meaningful in the future (which never came. Mwahahahaha!)