关于变量名的一个有趣的细节 [英] An interesting detail about variable name

查看:111
本文介绍了关于变量名的一个有趣的细节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了教程,在游戏上指定了不同类型的教程(但是,这是非常一般的)。

I have read tutorials all over the web with different kinds of tutorials specified on game (however, this turns out to be pretty general).

为什么许多开发人员将其变量命名为:

Are there any reasons to why many developers name their variables like:

mContext

对我来说,默认只是将它命名为context或类似的东西。

For me it is default to just name it "context" or something similar.

m是前? (我知道这是一个风格问题,但我只是好奇它的代表)

Are there any reasons why the "m" are before? (I know that this is a matter of style, but I'm just curious what it stands for)

推荐答案

c $ c> m 将表示该对象是相关类的成员变量。这是匈牙利语符号常用的名称前缀的变量的目的或类型的线索。

The m will be to signify that the object is a member variable of the class in question. It's a common use of Hungarian Notation to prefix the name with clues to the variable's purpose or type.

这篇关于关于变量名的一个有趣的细节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆