Data Names

原创 2004年09月30日 22:26:00

1. Express exact meaning.
2. As short as possible.

Naming Loop Indexes
In common, we can use the names such as i,j and k; but when loop is long and complex, we should use a meaningful name like recordCount.

Naming Status Variables
Think of a better name than flag for status variables.

Naming Temporary Vriables
In one way or another, most of the variables in your program are temporary.  Calling a few of them temporary may indicate that you aren't sure of their real purpose. So also give it a meaningful name.

Naming Boolean Variable
Give boolean variables names that imply True of False, such as Is....
Use positive boolean variable names.

Naming Enumerated Types
Give a group prefix to these variables.

Conventions for names
1. Differentiate between variable and routine name.
variable name is begin with lower case and routine name with upper case.
2. Differentiate bwtween clases and objects
Differentiating them via initial Capitalization.
3. Identify global variables
use g_ prefix.
4. Identify member variables.
use m_ prefix.
5. Identify type definitions
prefix the type names before the variable.
6. Format names to enhance readability.
Two common techiniques for increasing readability are using capitalization and spacing characters to separate words.

Comments on Abbreviations
1. Don't abbreviate by removing one characters from a word.
2. Abbreviate consistenly.
3. Create names that you can pronounce.
4. Avoid combinations that result in mispronunciation.
5. Use a thesaurus to resolve naming collisions.
6. Document extremely short names with translation tables in the code.
7. Document all abbreviations in a project-level "Standard Abbreviations" document.

Kinds of Names to Avoid
1. Avoid misleading names or abbreviations.
2. Avoid names with similar meanings.
3. Avoid variables with different meanings but similar names.
4. Avoid names that sound similar.
5. Avoid numberals in names.
6. Avoid misspelled words in names.
7. Avoid words that are commonly misspelled in English.
8. Avoid names containing hard-to-read characters.

ajax传数组到后台

js代码 function login123(){ var nameArr = new Array(); nameArr.push("adm,in"); ...
  • u010924288
  • u010924288
  • 2016年07月13日 01:21
  • 184

Ajax 传递数组到后台

Js代码   function login123(){           var nameArr = new Array();           nameArr.push("ad...
  • qq_21262611
  • qq_21262611
  • 2016年09月05日 09:43
  • 153

MySql中SET NAMES utf8详解(乱码原理)

不多说,先上图 分析: set names utf8之前, character_set_client     | gbk character_set_connection| gbk ch...
  • kakarot5
  • kakarot5
  • 2014年10月14日 23:00
  • 4586

set names utf8 详解

以为pconnect有问题,迷惑了好长时间,但是最后竟然发现自己错将set names utf8写成set names utf-8了,真糊涂! 下面文章偷来的,仅供参考! 新的主机的Mysql是5...
  • huangjianxiang1875
  • huangjianxiang1875
  • 2012年08月19日 11:27
  • 2093

MYSQl乱码可以用:mysql_query("set names 'gbk'");

编码导致的乱码,今天折腾了不少时间。也不知道哪里出错了,明明PHP文件编码和MYSQL的编码是一致的。但植入的数据确最终成了中文乱码。调整了多种编码其结果皆一样。最终还是凭借着mysql_query(...
  • qiuyu8888
  • qiuyu8888
  • 2011年08月02日 22:34
  • 5330

codeforces--510C--Fox And Names

Fox And Names time limit per test 2 seconds memory limit per test 256 megabytes inp...
  • u013015642
  • u013015642
  • 2015年02月03日 14:06
  • 1032

MySQL为什么要set names

大家都知道 SET NAMES x 相当于 SET character_set_client = x; SET character_set_results = x; SET characte...
  • y_h_t
  • y_h_t
  • 2014年01月08日 10:27
  • 3128

[!] The 'Pods-lingfo' target has frameworks with conflicting names: ummobclick.framework.

今天更新百度地图框架时出现这个问题。 解决方案:先把友盟注释掉 重新update 这下没问题了,然后重新打开注释的幽梦再update 之前的错误就没有了 ----pod install----...
  • Leemin_ios
  • Leemin_ios
  • 2017年03月06日 16:30
  • 529

为了让你的网页能在更多的服务器上正常地显示,还是加上“SET NAMES UTF8”吧

为了让你的网页能在更多的服务器上正常地显示,还是加上“SET NAMES UTF8”吧2007-05-28 09:18 ...
  • wzwsj1986
  • wzwsj1986
  • 2007年08月02日 23:50
  • 14647

【java细节】Java代码忽略https证书:No subject alternative names present

做项目提供restful api,本地部署访问http://localhost:8080可以正确访问,当部署到一个高安全性的服务器上时,项目访问路径变成了https://xxx.xxx.xxx.xxx...
  • audioo1
  • audioo1
  • 2016年06月23日 19:57
  • 8728
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Data Names
举报原因:
原因补充:

(最多只允许输入30个字)