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 4607236
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:40:29+00:00 2026-05-22T00:40:29+00:00

Except for non human readable code is there another reason not to use var

  • 0

Except for non human readable code is there another reason not to use var for every variable in functions? I mean is it performance hit not to use int, SqlCommand, string but use var instead?

  • 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-22T00:40:30+00:00Added an answer on May 22, 2026 at 12:40 am

    It’s about implicit and explicit typing. C#.NET is a typed language, meaning that you define what type of data is stored in memory. If you don’t define that, you make some operations less safe, so you want to type explicitly as much as possibly. However in some cases the type is really obvious from your code, so you can just leave it up to the compiler to figure out what type the variable should be, which is implicit typing.

    A problem with not having types is that in memory, which is essentially a bunch of 1’s and 0’s this data could mean anything, so if you originally put in an integer at location 000001 and then later try to read it as Cat (just imagine that being some type), then nothing of what you just read out from memory will make much sense. So that is the reason that a type system was invented, to tell you what data you are storing where and to make sure that you read data back in a way which can be understood again by humans, as for a machine it doesn’t really matter at the end of the day what the data is.

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

Sidebar

Related Questions

Exception Thrown: System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable Does this mean I missed marking
I am trying to parse a timestamp into a human-readable date string, however, I
Are there any Open Source online IDE's except for Bespin? If found some online
I have not yet found the best solution for this. I have a non
I want to remove everything after and including the decimal, and everything non-numerical except
I currently use the non-standard filter method of rendering opacity on my site in
Exception is: 'Country' has a SelectedValue which is invalid because it does not exist
Is there a way to keep the tags from being nulled as soon as
fma(a,b,c) is equivalent to a*b+c except it doesn't round intermediate result. Could you give
Tornado advertises itself as a relatively simple, non-blocking web server framework and was designed

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.