Click here to Skip to main content
15,913,773 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: The Laziness of LINQ Pin
Rowdy Raider13-Aug-15 5:01
Rowdy Raider13-Aug-15 5:01 
GeneralRe: The Laziness of LINQ Pin
Super Lloyd11-Aug-15 16:11
Super Lloyd11-Aug-15 16:11 
GeneralRe: The Laziness of LINQ Pin
Camilo Reyes11-Aug-15 16:37
professionalCamilo Reyes11-Aug-15 16:37 
GeneralRe: The Laziness of LINQ Pin
codejager13-Aug-15 23:07
codejager13-Aug-15 23:07 
GeneralRe: The Laziness of LINQ Pin
Steve Wellens11-Aug-15 18:10
Steve Wellens11-Aug-15 18:10 
GeneralRe: The Laziness of LINQ PinPopular
ImHere2Learn11-Aug-15 18:41
professionalImHere2Learn11-Aug-15 18:41 
GeneralRe: The Laziness of LINQ Pin
Dominic Burford11-Aug-15 21:32
professionalDominic Burford11-Aug-15 21:32 
GeneralRe: The Laziness of LINQ PinPopular
OriginalGriff11-Aug-15 22:09
mveOriginalGriff11-Aug-15 22:09 
It compromises all over the place!

It saves you a couple of seconds of typing, but makes it harder to maintain because you can't just glance at the code and see what type a variable is.
When you see code like:
C#
var order = GetOrder(orderId);
You can't trust that order is of type Order because you are relying on the previous programmer (who you know to be lazy) to have still returned an Order from his method and not something totally different but been too lazy to change the name!
Seeing it as:
C#
Order order = GetOrder(orderId);
Make it absolutely obvious at a glance - and will immediately throw a compiler error if you change the method return type. Or if the wrong using block has been added and GetOrder comes from the wrong assembly alltogether.

Yes, these are extreme cases - but an extra second or two of your time and it would be clear.

var has it's place, and it's vital for Linq - but that's where it should stay! Laugh | :laugh:
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: The Laziness of LINQ Pin
Rowdy Raider13-Aug-15 4:54
Rowdy Raider13-Aug-15 4:54 
GeneralRe: The Laziness of LINQ Pin
codejager13-Aug-15 23:05
codejager13-Aug-15 23:05 
GeneralRe: The Laziness of LINQ Pin
PIEBALDconsult13-Aug-15 6:07
mvePIEBALDconsult13-Aug-15 6:07 
GeneralRe: The Laziness of LINQ Pin
Steve Wellens12-Aug-15 2:57
Steve Wellens12-Aug-15 2:57 
GeneralRe: The Laziness of LINQ Pin
Steven Melendez14-Aug-15 2:46
Steven Melendez14-Aug-15 2:46 
JokeRe: The Laziness of LINQ Pin
Agent__00711-Aug-15 18:46
professionalAgent__00711-Aug-15 18:46 
GeneralRe: The Laziness of LINQ Pin
ZurdoDev12-Aug-15 1:18
professionalZurdoDev12-Aug-15 1:18 
GeneralRe: The Laziness of LINQ Pin
V.11-Aug-15 20:06
professionalV.11-Aug-15 20:06 
QuestionRe: The Laziness of LINQ Pin
CPallini11-Aug-15 20:34
mveCPallini11-Aug-15 20:34 
GeneralRe: The Laziness of LINQ Pin
Kornfeld Eliyahu Peter11-Aug-15 21:14
professionalKornfeld Eliyahu Peter11-Aug-15 21:14 
JokeRe: The Laziness of LINQ Pin
Mycroft Holmes11-Aug-15 21:25
professionalMycroft Holmes11-Aug-15 21:25 
GeneralRe: The Laziness of LINQ Pin
Wastedtalent11-Aug-15 21:31
professionalWastedtalent11-Aug-15 21:31 
GeneralRe: The Laziness of LINQ Pin
Dominic Burford11-Aug-15 21:35
professionalDominic Burford11-Aug-15 21:35 
GeneralRe: The Laziness of LINQ Pin
Kornfeld Eliyahu Peter11-Aug-15 21:54
professionalKornfeld Eliyahu Peter11-Aug-15 21:54 
GeneralRe: The Laziness of LINQ Pin
Vark11112-Aug-15 9:10
Vark11112-Aug-15 9:10 
GeneralRe: The Laziness of LINQ Pin
maze312-Aug-15 22:28
professionalmaze312-Aug-15 22:28 
GeneralRe: The Laziness of LINQ Pin
Rob Philpott11-Aug-15 22:54
Rob Philpott11-Aug-15 22:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.