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

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

问题描述

我已经阅读教程全部在网上与不同类型的游戏上指定教程(然而,这原来是pretty的总称)。

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

对我来说这是默认的,只是将其命名为背景或类似的东西。

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)

推荐答案

M 将是表示该对象是类问题的一个成员变量。这是一个常见的​​使用匈牙利命名法以preFIX有线索了变量的用途或类型的名称。

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天全站免登陆