开发者

CClass IInterface

If this is Hungarian notation (CClass and IInterface), is there 开发者_运维百科a way around it? I generally don't use Hungarian notation and I'm not sure if it's wise to do this out of habit.


No, Hungarian notation deals with specifying type information via prefixes. This is a lot more specific than the conventions of prefixing "I" to interfaces and "C" to classes, for example using bstrTestString as a name for a BSTR containing a test string (my own example, probably not mandated by the usual Hungarian notation examples).

Adding "I" and "C" is a very widespread convention, and is generally supported in most IDEs. I personally think the benefit (quickly seeing whether "RandomType" is a class or interface) is worth the tiny overhead.


It's purely a convention. The way around it is to just not do it.

I personally don't like it either, but I tend to do a minimal version of it when writing Windows code, because there's some communication value in following local convention.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜