本文作者: jsweibo
本文链接: https://jsweibo.github.io/2019/05/26/%E4%BB%80%E4%B9%88%E6%98%AFHungarian-Notation%E5%91%BD%E5%90%8D%E6%B3%95/
摘要
本文主要讲述了:
- 什么是 Hungarian Notation
- 示例
正文
什么是 Hungarian Notation
Hungarian Notation(匈牙利命名法)。
在计算机术语中,Hungarian Notation 指的是一种变量命名规则。
Hungarian Notation 要求在变量的名称之前加上前缀来表示变量类型。
在早年,由于 IDE 能力低下(想象一下只用 notepad 编写代码),Hungarian Notation 在代码语义化、错误检查等方面起到了一定的积极作用。但随着 IDE 能力不断提升,现在已经没有必要去使用 Hungarian Notation。
示例
strName
表示变量类型是字符串。pName
表示变量类型是指针。
参考资料
本文作者: jsweibo
本文链接: https://jsweibo.github.io/2019/05/26/%E4%BB%80%E4%B9%88%E6%98%AFHungarian-Notation%E5%91%BD%E5%90%8D%E6%B3%95/
本文对你有帮助?请支持我

