Why the capitalization?

Last post 09-29-2009 10:02 AM by gerrylowry. 5 replies.

Sort Posts:

  • Why the capitalization?

    09-28-2009, 5:46 PM
    • Member
      136 point Member
    • DiNASTY
    • Member since 09-28-2006, 1:43 AM
    • Posts 94

    I'm hoping someone can explain to me why pretty much every single resource in ASP.NET MVC, including the models, controllers and views themselves, are capitalized. Is this a naming convention that crossed over from WinForms?

    I know it's mostly personal preference, and that the routing engine is not case sensitive, however, there are real reasons why there should be NO capitalization in URLs.

    1. It is easier for people to type URLs that have no capitalization.
    2. The average visitor will think it's case sensitive, and capitalize letters anyways.
    3. It's ugly.
    4. Faster development (Saves a few hundred shift-keys per day).
    5. Technically inclined visitors can immediately tell that you're using ASP.NET MVC (I'm a proud MS user, but I'd rather advertise it to the world in the form of capitalized views).
    6. SEO? (people don't capitalizes their search terms).

    That said, it's a real pain to have to go though the entire default MVC template and lower the case on everything.

  • Re: Why the capitalization?

    09-28-2009, 6:44 PM
    • Contributor
      6,631 point Contributor
    • gerrylowry
    • Member since 07-02-2008, 9:46 PM
    • alliston ontario canada
    • Posts 2,271

    http://localhost:4629/home/index works.

    as you mentioned, the routing engine is case insensitive.

    I did not have to lower case anything.

    I am guessing SEO lowercases everything such that Home/Index and home/index equate to the same value.


    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Why the capitalization?

    09-28-2009, 6:56 PM
    • Contributor
      6,631 point Contributor
    • gerrylowry
    • Member since 07-02-2008, 9:46 PM
    • alliston ontario canada
    • Posts 2,271

    DiNASTY:
    The average visitor will think it's case sensitive, and capitalize letters anyways.

    the average vistor is not going to type Home/Index

    I made this small change to Site.Master:

    <div id="menucontainer">
    <ul id="menu">              
    <li><%= Html.ActionLink("home", "index", "home")%></li>
    <li><%= Html.ActionLink("about", "about", "home")%></li>
    </ul>
    </div>

    When I run this do nothing application, it displays as:

    http://localhost:4629/

    If I click the "about" tab, I see:

    http://localhost:4629/home/about

    I can use:

    http://localhost:4629/home

    Even:

    http://localhost:4629/home/ABOUT

    At a real ASP.NET MVC site:

    http://stackoverflow.com/questions/1489668/reflection-c-question and

    http://stackoverflow.com/QUESTIONS/1489668/reflection-c-question

    both work.


    Gerry

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Why the capitalization?

    09-28-2009, 6:57 PM
    • Contributor
      6,631 point Contributor
    • gerrylowry
    • Member since 07-02-2008, 9:46 PM
    • alliston ontario canada
    • Posts 2,271

    P.S.:  mostly, the average visitor will click her/his way around your site.

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Why the capitalization?

    09-29-2009, 12:07 AM
    • Member
      136 point Member
    • DiNASTY
    • Member since 09-28-2006, 1:43 AM
    • Posts 94

    gerrylowry:

    P.S.:  mostly, the average visitor will click her/his way around your site.


    This is true. 

    I guess I'm just frustrated with the naming convention itself. Obviously, I'm not alone, as I see stackoverflow lowered the case on their ActionLinks as well. I'll just have to explain to the next developer that picks up my project that /home/about actually points to the About.aspx view. No biggie.

    Thanks,

    -Derek

  • Re: Why the capitalization?

    09-29-2009, 10:02 AM
    Answer
    • Contributor
      6,631 point Contributor
    • gerrylowry
    • Member since 07-02-2008, 9:46 PM
    • alliston ontario canada
    • Posts 2,271

    DiNASTY:
    I'll just have to explain to the next developer that picks up my project that /home/about actually points to the About.aspx view.

    Derek, you are welcome.

    If you want to bother, you can rename About.aspx to about.aspx ... it still works.
    You probably already know that.

    BTW, I agree with you.  I wonder why they went with uppercase
    names for the pages when the lower case names work too.

    The other thing is that AFAIK, case insensitivity in an Internet
    context is not really appropriate.

    In a Windows world, myfile.txt and MyFile.txt are the same file.

    In a broader Internet world, myfile.txt is not the same as MyFile.txt
    because file names are normally case sensitive.  AFAIK, this is
    because UNIX/Linux treats file names this way.

    I am guessing that either the ASP.NET MVC went with case insensitivity
    on purpose, or that case insensitivity is a side effect of ASP.NET MVC
    being hosted on a Windows platform.  The latter is more likely AFAIK.


    Regards,
    Gerry (Lowry)

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
Page 1 of 1 (6 items)