Click here to Skip to main content
15,891,431 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: What "advanced" features of programming languages do you use? Pin
Sander Rossel20-Jan-20 3:36
professionalSander Rossel20-Jan-20 3:36 
GeneralRe: What "advanced" features of programming languages do you use? Pin
User 1106097920-Jan-20 6:10
User 1106097920-Jan-20 6:10 
GeneralRe: What "advanced" features of programming languages do you use? Pin
RugbyLeague20-Jan-20 3:30
RugbyLeague20-Jan-20 3:30 
GeneralRe: What "advanced" features of programming languages do you use? Pin
DRHuff20-Jan-20 3:59
DRHuff20-Jan-20 3:59 
GeneralRe: What "advanced" features of programming languages do you use? Pin
honey the codewitch20-Jan-20 6:58
mvahoney the codewitch20-Jan-20 6:58 
GeneralRe: What "advanced" features of programming languages do you use? Pin
Gary R. Wheeler20-Jan-20 15:20
Gary R. Wheeler20-Jan-20 15:20 
GeneralRe: What "advanced" features of programming languages do you use? Pin
rjmoses20-Jan-20 23:27
professionalrjmoses20-Jan-20 23:27 
GeneralRe: What "advanced" features of programming languages do you use? Pin
Stefan_Lang20-Jan-20 20:46
Stefan_Lang20-Jan-20 20:46 
I find it interesting that many seem to think 'var' is such a bad thing. In C++, there's the auto keyword, and there's even the complementary keyword decltype which is particularly useful when you want the result type of an expression, or the return type of a function.

As I understand it, auto fills a similar role as var does in other language(s?), and there's actually a coding guideline promoted by Herb Sutter, no less, to 'aaa', or 'almost always [use] auto'. One of the main reasons is to help enforce type safety, which of course is outstandingly important in C++, probably more than in any other language. Another reason is maintainability: every use of auto probably doesn't need to be changed when you change some type in your code later.

That said, I often deliberately don't use auto, for one (or both) of two reasons: helping with autocompletion (the editor sometimes won't know what member variables and methods to suggest when dereferencing an auto variable), readability (provided the type name is easy enough to read, rather than a nested<type>::with<template_arguments>), and disambiguation (when I want the value to remain unchanged - i. e. const - rather than modifiable). I suspect the former will no longer be a reason when we finally manage to switch to a newer IDE version later this year, that's why I said two reasons Wink | ;)
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

GeneralRe: What "advanced" features of programming languages do you use? Pin
Greg Utas21-Jan-20 1:31
professionalGreg Utas21-Jan-20 1:31 
GeneralThat's how we "always" work Pin
Sander Rossel20-Jan-20 0:50
professionalSander Rossel20-Jan-20 0:50 
GeneralRe: That's how we "always" work Pin
phil.o20-Jan-20 1:10
professionalphil.o20-Jan-20 1:10 
GeneralRe: That's how we "always" work Pin
Sander Rossel20-Jan-20 2:03
professionalSander Rossel20-Jan-20 2:03 
GeneralRe: That's how we "always" work Pin
rjmoses20-Jan-20 1:12
professionalrjmoses20-Jan-20 1:12 
GeneralRe: That's how we "always" work Pin
Daniel Pfeffer20-Jan-20 1:42
professionalDaniel Pfeffer20-Jan-20 1:42 
GeneralRe: That's how we "always" work Pin
Sander Rossel20-Jan-20 2:15
professionalSander Rossel20-Jan-20 2:15 
GeneralRe: That's how we "always" work Pin
Rick York20-Jan-20 5:32
mveRick York20-Jan-20 5:32 
GeneralRe: That's how we "always" work Pin
rjmoses20-Jan-20 6:37
professionalrjmoses20-Jan-20 6:37 
GeneralRe: That's how we "always" work Pin
Mark_Wallace20-Jan-20 23:18
Mark_Wallace20-Jan-20 23:18 
GeneralWSO CCC OTD 2020-01-20 Pin
OriginalGriff19-Jan-20 21:43
mveOriginalGriff19-Jan-20 21:43 
GeneralRe: WSO CCC OTD 2020-01-20 Pin
super19-Jan-20 22:44
professionalsuper19-Jan-20 22:44 
GeneralRe: WSO CCC OTD 2020-01-20 Pin
OriginalGriff19-Jan-20 22:54
mveOriginalGriff19-Jan-20 22:54 
GeneralThe secret of Bob... Pin
Kornfeld Eliyahu Peter19-Jan-20 20:26
professionalKornfeld Eliyahu Peter19-Jan-20 20:26 
GeneralRe: The secret of Bob... Pin
OriginalGriff19-Jan-20 20:41
mveOriginalGriff19-Jan-20 20:41 
GeneralRe: The secret of Bob... Pin
Kornfeld Eliyahu Peter19-Jan-20 20:43
professionalKornfeld Eliyahu Peter19-Jan-20 20:43 
GeneralRe: The secret of Bob... Pin
Mark_Wallace19-Jan-20 21:34
Mark_Wallace19-Jan-20 21:34 

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.