textBoxEmployeeName vs employeeNameTextBox

后端 未结 16 963
死守一世寂寞
死守一世寂寞 2020-12-16 00:11

Which naming convention do you use and why?

I like to use employeeNameTextBox, because:

  • It seems more natural from an English language perspective.
16条回答
  •  执笔经年
    2020-12-16 01:08

    I propose a third option: uiEmployeName. Reasons:

    1. It's not Hungarian. Both of the notations you mention are just flavors of Hungarian.
    2. If you change an employee name text box over to a listbox you don't need to rename your variables.
    3. Everything is grouped nicely in the intellisense without involving the type of the object.
    4. The name of the object closely follows its function. It is a user-facing object that gets the employee name.

提交回复
热议问题