Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 514599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:32:30+00:00 2026-05-13T07:32:30+00:00

Microsoft is pretty clear that .NET identifiers or parameters should not contain abbreviations. Straight

  • 0

Microsoft is pretty clear that .NET “identifiers” or “parameters” should not contain abbreviations. Straight from the horse’s mouth:

To avoid confusion and guarantee cross-language interoperation, follow these rules regarding the use of abbreviations:

  • Do not use abbreviations or contractions as parts of identifier names. For example, use GetWindow instead of GetWin.
  • Do not use acronyms that are not generally accepted in the computing field.
  • Where appropriate, use well-known acronyms to replace lengthy phrase names. For example, use UI for User Interface and OLAP for On-line Analytical Processing.
  • 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.
  • Do not use abbreviations in identifiers or parameter names. If you must use abbreviations, use camel case for abbreviations that consist of more than two characters, even if this contradicts the standard abbreviation of the word.

– http://msdn.microsoft.com/en-us/library/141e06ef%28VS.71%29.aspx


Yet, if you take a look at MSDN’s own 101 LINQ Samples page, you will find tons of examples like this…

var productNames =
    from p in products
    select p.ProductName;

…and very few (none?) like this…

var productNames =
    from product in products
    select product.ProductName

…but on other MSDN pages, you’ll find examples that spell things out (e.g., http://msdn.microsoft.com/en-us/library/bb384065.aspx).

Discussion

I have mixed feelings about this. With intellisense, it’s not exactly a hardship to spell everything out, but I’m not sure there’s much advantage in it either. Is it more readable or less? You’re sort of trading off wordiness for clarity. SQL programmers seem to get along well enough with short abbreviations for table names, but then again, programmers used to survive using Hungarian notation, too, and that’s been pretty well proven to be a bad idea.

So, a couple questions:

  1. Is there any official guidance on whether LINQ queries should be abbreviated or not?
  2. What is your particular preference and why?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:32:30+00:00Added an answer on May 13, 2026 at 7:32 am

    I suppose you could say that a range variable doesn’t really follow the same rules as other identifiers, since its scope is entirely limited to the query expression. It’s a bit more obvious what “p” means because you’re never looking at it outside the context of from p in products.

    My preference – and perhaps I shouldn’t be admitting this – is just to use “p”. To be honest, I simply don’t see the point in descriptively naming something that can only ever be used in one statement.

    Imagine you’re writing a lambda expression instead. Would you write:

    products.Where(p.ProductID == productID).Select(p => p.ProductName)
    

    or

    products.Where(product.ProductID == productID).Select(product => product.ProductName)
    

    I actually find the first version more readable, but maybe that’s just personal preference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Microsoft recently announced that the Javascript/HTML DOM library jQuery will be integrated into the
Microsoft recently announced that they were endorsing jQuery as an officially supported JavaScript library.
Microsoft released the source for Oxite , their blogging engine that's intended to help
I'm trying to create a pretty simple graphing component that consists of a series
Edit: Just wanted to make the question I have more clear. I pretty much
I have a list of about 25 types found in the Microsoft .NET assembly
Just to be clear before continuing: using PHP's built-in SOAP class is unfortunately not
this is pretty strange. I've got this string that connect to a SQLServer in
I've seen that Microsoft has created a official jQuery Template plugin for jQuery. But
Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.