Naming Conventions in C# - underscores

前端 未结 3 1964
时光说笑
时光说笑 2020-12-28 14:33

I saw this at an MVC3 Razor tutorial at http://www.asp.net

public ActionResult Index() {

    return View(_usrs._usrList);

}

Isn\'t that u

3条回答
  •  暖寄归人
    2020-12-28 14:46

    The guidelines are summarized here http://blogs.msdn.com/b/brada/archive/2005/01/26/361363.aspx and include the stipulation to use "this." instead of underscore. But I find that peppering my code with "this."'s makes the code more wordy, cluttered and hard-to-read. Furthermore it seems to be less often followed than underscore so as a convention, "_" seems more conventional.

提交回复
热议问题