Click here to Skip to main content
14,638,374 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
HobbyProggy10-Apr-18 1:56
professionalHobbyProggy10-Apr-18 1:56 
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 
Sander Rossel wrote:
Just use an anonymous type a tuple, get the fields you want, use them in just that one function, and be done with it.
FTFY

Sander Rossel wrote:
Creating a class just to be used in a single function is kind of overkill and clutters your code base.
It could be argued that mixing dataaccess into your functions also clutters the code.

Sander Rossel wrote:
Your front-end makes it JavaScript so it loses its type anyway.
Not everything is used on the web, but I would use typed code in the business layer anyway, it lower the number of bugs considerably.
Note that anonymous classes are still typed, you just don't know what type. I just prefer to know!

Sander Rossel wrote:
You may not need them per se, but it makes your code cleaner and easier to read.
That's an opinion.
Wrong is evil and must be defeated. - Jeff Ello

GeneralRe: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 21:09
professionalSander Rossel10-Apr-18 21:09 
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 

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.