Variable naming
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
The way I usually roll is hungarian notation(I think that's what it's called). EX: btnRebootSystem for a button lstExclusions txtMessageToSend .... You get the idea... You get a quick rundown of the control you are dealing with in code, and a longer explanation of what it does. I recommend that over your examples
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
http://weblogs.asp.net/scottdockendorf/archive/2005/01/26/361020.aspx[^]
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
Well I use for example UploadVideoButton and UploadVideoButton_Click that is also the way it should be done, all other ways are just stupid. ;);):)
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand -
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
I prefer name mangling? Let the developer guess what the click event will be: Is it x or aaa?
Deja View - the feeling that you've seen this post before.
-
I prefer name mangling? Let the developer guess what the click event will be: Is it x or aaa?
Deja View - the feeling that you've seen this post before.
Pete O`Hanlon wrote:
name mangling
But that is good during release right? Since mangled names hinder easier debugging.
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
The way I usually roll is hungarian notation(I think that's what it's called). EX: btnRebootSystem for a button lstExclusions txtMessageToSend .... You get the idea... You get a quick rundown of the control you are dealing with in code, and a longer explanation of what it does. I recommend that over your examples
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
I prefer that too since if there are many widgets on a form I may forget exact name, but as long as I remember the type of a widget I'll simply write btn... and intelisense will give me nice sorted list of all buttons I have on the form, otherwise you'd have to guess is it RebootSystem or SystemReboot or Restart, or any of the other half-a-dozen variations etc, etc, etc. Events will simply have _action appended at the end, for example btnOK_click (which is default in vs200x), nice and self-explanatory.
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
button_button_whos_clicked_the_button
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Well I use for example UploadVideoButton and UploadVideoButton_Click that is also the way it should be done, all other ways are just stupid. ;);):)
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn RandRohde wrote:
UploadVideoButton
Mine too, all jokes aside. If I don't name the widgets for their functions, I'll eventually forget that Button1 operates launch and Button2 operates self-destruct.... kind of important not to mix those two... ;) Seriously though, naming for function is smart, buttonaa or abuttonxxx tells you nothing (unless the latter is launching unmentionable videos).
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
Why type so much when you don't have to: g. b, bc
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
None of those. I like: x, x_Click where x = ok, cancel, save, etc.
Man is a marvelous curiosity ... he thinks he is the Creator's pet ... he even believes the Creator loves him; has a passion for him; sits up nights to admire him; yes and watch over him and keep him out of trouble. He prays to him and thinks He listens. Isn't it a quaint idea. - Mark Twain
-
I'm an ASP.NET developer. I would like to ask about a coding style standard. I have a button and click event of that button, what would you suggest for naming? a. XXButton, XXButton_Click b. xXButton, xXButton_Click c. xXButton, XXButton_Click d. ButtonXX, ButtonXX_Click e. ButtonXX, buttonXX_Click f. buttonXX, buttonXX_Click Which one do you prefer?
My usual is f. I used to use pseudo-Hungarian only on UI elements, like btnXX, but I thought I'd make a clean break and adopt fashionable long variable names. All my UI stuff I do like that now, so a textbox is 'textName' etc.