Click here to Skip to main content
14,664,775 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: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 7:39
professionalSander Rossel10-Apr-18 7:39 
GeneralRe: Worst use of var I've seen... Pin
HobbyProggy10-Apr-18 19:38
professionalHobbyProggy10-Apr-18 19:38 
GeneralRe: Worst use of var I've seen... Pin
Jörgen Andersson9-Apr-18 22:08
professionalJörgen Andersson9-Apr-18 22:08 
GeneralRe: Worst use of var I've seen... Pin
Sander Rossel9-Apr-18 23:50
professionalSander Rossel9-Apr-18 23:50 
GeneralRe: Worst use of var I've seen... Pin
Jörgen Andersson10-Apr-18 2:36
professionalJörgen Andersson10-Apr-18 2:36 
GeneralRe: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 7:37
professionalSander Rossel10-Apr-18 7:37 
GeneralRe: Worst use of var I've seen... Pin
Jörgen Andersson10-Apr-18 20:56
professionalJörgen Andersson10-Apr-18 20:56 
GeneralRe: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 21:09
professionalSander Rossel10-Apr-18 21:09 
A TUPLE!?
Because having property names "Field1", "Field2" and "Field3" is so much better than actual meaningful property names? Confused | :confused:
I've used tuples once or twice and I've always came to regret it when I needed to change the code a week later.
Tuples were added for support with functional languages, F# specifically, that use tuples a little different than C#.
Jörgen Andersson wrote:
It could be argued that mixing dataaccess into your functions also clutters the code.
Again, you're talking about bad practice and there are very good reasons to "clutter" your code here. Using anonymous types is NOT bad practice.
Jörgen Andersson wrote:
Note that anonymous classes are still typed, you just don't know what type. I just prefer to know!
Why does the type of the object matter so much? It's just a type with some strong-typed properties that you'll never use again.
In cases such as this you're not using the type at all, so why type it out?
return Json(new { Name = name, Valid = valid });
Jörgen Andersson wrote:
That's an opinion fact.
FTFY Big Grin | :-D

GeneralRe: Worst use of var I've seen... Pin
Jörgen Andersson10-Apr-18 21:17
professionalJörgen Andersson10-Apr-18 21:17 
GeneralRe: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 22:03
professionalSander Rossel10-Apr-18 22:03 
GeneralRe: Worst use of var I've seen... Pin
RickZeeland9-Apr-18 22:48
mveRickZeeland9-Apr-18 22:48 
GeneralRe: Worst use of var I've seen... Pin
PeejayAdams9-Apr-18 22:54
MemberPeejayAdams9-Apr-18 22:54 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore9-Apr-18 23:30
mveF-ES Sitecore9-Apr-18 23:30 
GeneralRe: Worst use of var I've seen... Pin
RickZeeland9-Apr-18 23:43
mveRickZeeland9-Apr-18 23:43 
GeneralRe: Worst use of var I've seen... Pin
HobbyProggy9-Apr-18 23:44
professionalHobbyProggy9-Apr-18 23:44 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 3:58
professionalSlacker00710-Apr-18 3:58 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 4:20
mveF-ES Sitecore10-Apr-18 4:20 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 4:21
professionalSlacker00710-Apr-18 4:21 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 4:40
mveF-ES Sitecore10-Apr-18 4:40 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 4:43
professionalSlacker00710-Apr-18 4:43 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 4:54
mveF-ES Sitecore10-Apr-18 4:54 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 5:05
professionalSlacker00710-Apr-18 5:05 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 5:11
mveF-ES Sitecore10-Apr-18 5:11 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 5:12
professionalSlacker00710-Apr-18 5:12 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 5:15
mveF-ES Sitecore10-Apr-18 5:15 

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.