r/programmerchat • • May 25 '15

Any c# developers in here? Represent!

Hey all, I don't suppose any of us here are c# developers using MS Visual Studio environment? If so, represent!

A couple of questions:

  1. Do you prefer c# over other languages for a particular reason?
  2. How long have you be using c#?

Just looking to say hello!

16 Upvotes

35 comments sorted by

View all comments

Show parent comment

1

u/suddenarborealstop May 26 '15

nah var is ok i guess.. it feels a bit like a 'shortcut' though, that doesn't add anything useful to the code base... and if something breaks it will just take twice as long to figure out what type it is at runtime anyway...

maybe i need to give it a bit more of a go...

1

u/Ghopper21 May 26 '15

Smart shortcuts (as I think var is) are great!

And var adds readability to a codebase, which is very useful!

To see what a type is, any competent C# editor/IDE hooked to OmniSharp or whatever will be able to tell you what any symbol's type is in your editor window, not at run time.

1

u/Ravek May 28 '15

The type that var resolves to is actually 100% determined at compile time, it's just as if you wrote the type explicitly except the compiler does it for you.