Click here to Skip to main content
14,693,685 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 2:56
professionalHobbyProggy10-Apr-18 2:56 
GeneralRe: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 8:39
professionalSander Rossel10-Apr-18 8:39 
GeneralRe: Worst use of var I've seen... Pin
HobbyProggy10-Apr-18 20:38
professionalHobbyProggy10-Apr-18 20:38 
GeneralRe: Worst use of var I've seen... Pin
Jörgen Andersson9-Apr-18 23:08
professionalJörgen Andersson9-Apr-18 23:08 
GeneralRe: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 0:50
professionalSander Rossel10-Apr-18 0:50 
GeneralRe: Worst use of var I've seen... Pin
Jörgen Andersson10-Apr-18 3:36
professionalJörgen Andersson10-Apr-18 3:36 
GeneralRe: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 8:37
professionalSander Rossel10-Apr-18 8:37 
GeneralRe: Worst use of var I've seen... Pin
Jörgen Andersson10-Apr-18 21:56
professionalJörgen Andersson10-Apr-18 21: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 22:09
professionalSander Rossel10-Apr-18 22:09 
GeneralRe: Worst use of var I've seen... Pin
Jörgen Andersson10-Apr-18 22:17
professionalJörgen Andersson10-Apr-18 22:17 
GeneralRe: Worst use of var I've seen... Pin
Sander Rossel10-Apr-18 23:03
professionalSander Rossel10-Apr-18 23:03 
GeneralRe: Worst use of var I've seen... Pin
RickZeeland9-Apr-18 23:48
mveRickZeeland9-Apr-18 23:48 
GeneralRe: Worst use of var I've seen... Pin
PeejayAdams9-Apr-18 23:54
MemberPeejayAdams9-Apr-18 23:54 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 0:30
mveF-ES Sitecore10-Apr-18 0:30 
GeneralRe: Worst use of var I've seen... Pin
RickZeeland10-Apr-18 0:43
mveRickZeeland10-Apr-18 0:43 
GeneralRe: Worst use of var I've seen... Pin
HobbyProggy10-Apr-18 0:44
professionalHobbyProggy10-Apr-18 0:44 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 4:58
professionalSlacker00710-Apr-18 4:58 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 5:20
mveF-ES Sitecore10-Apr-18 5:20 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 5:21
professionalSlacker00710-Apr-18 5:21 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 5:40
mveF-ES Sitecore10-Apr-18 5:40 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 5:43
professionalSlacker00710-Apr-18 5:43 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 5:54
mveF-ES Sitecore10-Apr-18 5:54 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 6:05
professionalSlacker00710-Apr-18 6:05 
GeneralRe: Worst use of var I've seen... Pin
F-ES Sitecore10-Apr-18 6:11
mveF-ES Sitecore10-Apr-18 6:11 
GeneralRe: Worst use of var I've seen... Pin
Slacker00710-Apr-18 6:12
professionalSlacker00710-Apr-18 6: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.