简而言之,匈牙利符号用变量名加上type(字符串)(系统匈牙利语)作为前缀是不好的,因为它没有用.匈牙利注释法的作者所希望的,在变量名前加上变量kind(以乔尔的示例为例:安全字符串或不安全字符串),因此所谓的Apps Hungarian具有其用途,并且仍然很有价值.I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparted, why shouldn't I put it right there where it's available?See also: Do people use the Hungarian naming conventions in the real world? 解决方案 Most people use Hungarian notation in a wrong way and are getting wrong results.Read this excellent article by Joel Spolsky: Making Wrong Code Look Wrong.In short, Hungarian Notation where you prefix your variable names with their type (string) (Systems Hungarian) is bad because it's useless.Hungarian Notation as it was intended by its author where you prefix the variable name with its kind (using Joel's example: safe string or unsafe string), so called Apps Hungarian has its uses and is still valuable. 这篇关于我为什么不应该使用“匈牙利符号"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-27 16:22