SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Object Naming

  1. #1
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Question Object Naming

    Ok, this is just a poll to get the pulse of what the majority of .NETters are doing.

    1) How finely do you adjust default names for newly placed controls? I.E. On a page with 29 or so <asp:Localize /> controls on it, do you actually go in and rename them from Localize1 - Localize20 to something like lclSomeThing, lclAnotherThing and lclThatThing?

    2) Once you create an initial master page, how drastically do you change the default placeholders in terms of naming and so forth. I.E. Are you irked that one is named ContentPlaceHolder1 and the other simply "head"?

  2. #2
    Chopped Liver bronze trophy imaginekitty's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    1,494
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I always name my items semantically.

  3. #3
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Even though it's something you'll never interact with in code? These are just there to auto-load textual resources from a locale.resx.

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,625
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    First, hungarian notation is a tool of the devil. Avoid it.

    For any control that matters--ie I am accessing it programatically, or even think I might access it programatically--I always give it a semantic name. Stuff that doesn't matter, I try and delete the ID parameter so one can't easily access them. If I ever see "somevar = TextBox1.Text" in production code, I whip whomsoever is responsible.

    PS: I should note I almost never use the drag-n-drop designer, so I never get auto-generated IDs anyhow.

  5. #5
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Ok, I was just wondering. I've had vs 2002 ent ed. since it was released. My copy of vs 2008 pro should arrive Tues (tomorrow as of this post), and I've been playing aorund with the trial version until then. In the interim years, I've been using php, and have just recently returned to the fold and needed to get up to speed on some things. Although, the "app" I'm writing as a test subject is just a personal little website. It's not going out for distribution or anything. Nobody will ever see the code except me.

  6. #6
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,625
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I've said that many times. Some of those apps are still in production to this day.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •