SubMain - CodeIt.Right The First Time!

/Community

Support Community for SubMain Products
 Home Products Services Download Purchase Support
in Search
 
Home Forums Blogs Tutorials/CIR Tutorials/GD Downloads
Welcome to SubMain Community Sign in | Join | Help

Capitalization questions

Last post 12-27-2006, 8:22 PM by Alex Dresko. 5 replies.
Sort Posts: Previous Next
  •  12-19-2006, 11:19 AM 133

    Capitalization questions

    Section 3.2.3 states:

    All letters in the identifier are capitalized. Use this convention only for identifiers that consist of two or fewer letters. For example:
    System.IO
    System.Web.IO

    The section then proceeds to show examples of the various capitalization techniques. My first complete is the "two or fewer letters" clause.. IMO, you should capitalize every letter of an abbreviated word.. For example, instead of:

    Dim table As New HtmlTable()

    I see nothing wrong with:

    Dim table As New HTMLTable()

    If the first letter of every word in an object's name is capitalized, then it is still easy to read even if the abbreviation falls in the middle of the name. For example:

    Dim crazyObject As New SuperFUBARThing()

    My second issue is that there are no capitalization examples just below this section.

    Anyway, I look forward to hearing your feedback on these issues.
    Filed under:
  •  12-19-2006, 11:46 AM 134 in reply to 133

    Capitalization questions

    Further.. it doesn't seem like section 3.4 makes much sense:

    When using acronyms, use Pascal case or camel case for acronyms more than two characters long. For example, use HtmlButton or HTMLButton. However, you should capitalize acronyms that consist of only two characters, such as System.IO instead of System.Io.

    Or maybe it's just not very clear.. (Also note that I meant acronym instead of abbreviation in my original post).

    IO is an acronym so every letter should be capitalized. Every letter of every acronym should be capitalized.
  •  12-19-2006, 3:51 PM 136 in reply to 134

    Capitalization questions

    Hi Alex,

    The "two or fewer letters only" acronym rule is based on Microsoft Guidelines for .NET.

    Thank you for your comments though, I can see your point.

    I'm wondering how many people share your opinion vs how many like the Microsoft recommendations?

    Anyone who got opinion on that, do you mind posting here?

    Or perhaps, we should run a poll?
    Thank you,
    Serge Baranovsky
    http://submain.com - .NET Developer Tools  |  Microsoft MVP  |  ASP Insider
    » » CodeIt.Right Will Fix Your Code!™ - http://submain.com/codeit.right
    » » C#/VB .NET Coding Guidelines - FREE 100+ page ebook (PDF) http://submain.com/guidelines
  •  12-19-2006, 6:03 PM 139 in reply to 136

    Capitalization questions

    Yes, I've seen that mentioned in the Microsoft guidelines, but I guess I don't see the point in deviating from the standard way of capitalizing words. Supposed someone doesn't know HTML is an acronym.. It's possible that the "html" in "HtmlTable" would be confused with being a real word. There are other acronyms that make this a better example.. Google "acronym" for an extensive list...
  •  12-22-2006, 5:48 PM 142 in reply to 139

    Capitalization questions

    Technically, HTML is an initialism, not an acronym. An acronym is a shortened word that can be pronounced like a word, as with BIOS or RADAR. I only bring this up because someone will invariably ask, "Why does the two-letter rule apply to IO, but not to Id" as is so often seen. The answer is that Id (identifier) is neither acronym nor initialism - it's an abbreviation.

    Back to the question at hand, it took me a long time to adjust to Html over HTML - after all, it isn't a word. I use the initial-cap form because it saves me having to make the whole team tweak the Code Analyzer.
  •  12-27-2006, 8:22 PM 145 in reply to 142

    Capitalization questions

    Because I find this topic interesting..

    From http://en.wikipedia.org/wiki/Acronym

    "There is no universal agreement about what distinction, if any, there is between the terms acronym and initialism; see the "Nomenclature" section below. Another term, alphabetism, is sometimes used to describe abbreviations pronounced as the names of letters."

    I've yet to read the entire contents of the link above. I see what you mean by Id and ID, but I'm still convinced it should be HTML instead of Html.. Sure, the code analyizer doesn't like it and it's slightly more difficult to type, but not everything Microsoft does or say is right IS necessarily right. :) Code maintainability is by far more important.
View as RSS news feed in XML
 
     
 
Home |  Products |  Services |  Download |  Purchase |  Support |  Community |  About Us |