如何命名变量 [英] How to name variables

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

问题描述

  • 您使用什么规则来命名变量?
  • 哪里允许单字母var?
  • 您在名称中输入了多少信息?
  • 例如代码怎么样?
  • 您首选的无意义的变量名称是什么? (在foo& bar之后)
  • 为什么要拼写"foo"和"bar" 而不是 FUBAR
  • What rules do you use to name your variables?
  • Where are single letter vars allowed?
  • How much info do you put in the name?
  • How about for example code?
  • What are your preferred meaningless variable names? (after foo & bar)
  • Why are they spelled "foo" and "bar" rather than FUBAR

推荐答案

function startEditing(){
   if (user.canEdit(currentDocument)){
      editorControl.setEditMode(true);
      setButtonDown(btnStartEditing);
   }
 }

读起来就像是叙事作品.

Should read like a narrative work.

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

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