与匈牙利表示法相反?
大多数程序员都知道一种叫做“匈牙利表示法”的东西,每个变量都有一个很好的前缀来表示其数据类型,即
bIsExciting = false; // Boolean
strName = "Gonzo"; // String
iNumber = 10; // Integer
虽然这种表示法风格已经不再受欢迎,但我(在工作、互联网等)看到了很多作为“后缀”添加到变量名称的数据类型指示符的数量,即
NameStr = "Gonzo"; // String
NumberInt = 10; // Integer
MyRideBike = new Bike(); // Bicycle
,当数据类型后缀到变量名称时,是否有相应的名称?
编辑:为了澄清......,这样的事情有独特的名称吗?如果没有,一些关于如何称呼它的简洁想法肯定会受到赞赏。
Most programmers know of a thing called 'Hungarian Notation', each variable has a nice prefix to denote its data type, i.e.
bIsExciting = false; // Boolean
strName = "Gonzo"; // String
iNumber = 10; // Integer
While this style of notation has fallen out of favor, I am seeing (at work, internet, etc.) a lot of data type indicators added as a 'suffix' to variable names, i.e.
NameStr = "Gonzo"; // String
NumberInt = 10; // Integer
MyRideBike = new Bike(); // Bicycle
Is there a name for this, when the data type is suffixed to a variable name?
EDIT: To clarify..., is there a distinct name for such a thing? If not, some concise ideas on what to call it would certainly be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是匈牙利表示法的反面,如果我们遵循Stroustrup 对匈牙利表示法的定义为“在变量名中嵌入类型的缩写版本”。如果你想给它起任何名字,可以将其命名为后缀匈牙利语。 (并且请告诉你的同事,这在大多数情况下是没有用的。)
This is not the opposite of Hungarian notation, this is Hungarian notation in a different guise, if we follow Stroustrup's definition of Hungarian notation as "embedding an abbreviated version of a type in a variable name". If you want to call it anything, call it suffix Hungarian. (And please tell your colleagues that it's useless in most cases.)
我将这种称为反向匈牙利表示法,它与波兰表示法和反向波兰表示法之间的差异一致。
此外,bilmcc 在以下链接上的帖子显示了术语“反向匈牙利表示法”的现实生活用法
您被迫遵循的最奇怪的编码标准规则是什么?
I would call this reverse hungarian notation which would be consistent with the difference between polish notation and reverse polish notation.
Additionally billmcc's post on the following link shows real life usage of the term "reverse hungarian notation"
What was the strangest coding standard rule that you were forced to follow?