Click here to Skip to main content
15,909,091 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: Modern C++ auto Pin
Dean Roddey24-Apr-19 10:19
Dean Roddey24-Apr-19 10:19 
GeneralRe: Modern C++ auto Pin
Rick Shaub24-Apr-19 10:25
Rick Shaub24-Apr-19 10:25 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 10:45
Dean Roddey24-Apr-19 10:45 
GeneralRe: Modern C++ auto Pin
Rick Shaub24-Apr-19 11:52
Rick Shaub24-Apr-19 11:52 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 12:00
Dean Roddey24-Apr-19 12:00 
GeneralNot Modern C++ auto Pin
bVagadishnu24-Apr-19 10:56
bVagadishnu24-Apr-19 10:56 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 7:26
Dean Roddey24-Apr-19 7:26 
GeneralRe: Modern C++ auto Pin
Carlosian24-Apr-19 5:38
Carlosian24-Apr-19 5:38 
I agree it can be easily abused. It is especially true if you are maintaining someone else's code. Yes, it's great for templated iterators and such, but it can also throw more work onto someone else down the road, which I consider rude or lazy.

Say I need to add some functionality. I see
C++
auto foo = SomeFunctionReturningObjOrRef(bar);
foo.SomeMethod(blah);


Great. That's really easy for the original dev, and really easy for the compiler. Wonderful. Now I need to add some code. What the heck is a "foo"? What members does it have? What methods are available? Is it a base class, or a derived class that has the functions I need? The dev who wrote the code knew, but didn't bother to declare it. The compiler knows, and I suppose I can just try

C++
foo.SomeMethodIHopeTheObjectHas();

And see if I get a compilation error. And hope that it really is the right type and not a base class or derived class of the one I expect...

But practically speaking I have to do the work the original dev didn't do and look up
SomeFunctionReturningObjOrRef()
and see what it does, and what it returns so I can be sure I'm getting the right type or that it supports the methods I need, and I don't actually want to be using "bar" or something else or upcast or downcast etc.
GeneralRe: Modern C++ auto Pin
Rick York24-Apr-19 6:48
mveRick York24-Apr-19 6:48 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 8:02
Dean Roddey24-Apr-19 8:02 
GeneralRe: Modern C++ auto Pin
Rick York24-Apr-19 10:51
mveRick York24-Apr-19 10:51 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 10:52
Dean Roddey24-Apr-19 10:52 
GeneralRe: Modern C++ auto Pin
Mark_Wallace24-Apr-19 11:11
Mark_Wallace24-Apr-19 11:11 
GeneralThought of the Day Pin
OriginalGriff23-Apr-19 4:42
mveOriginalGriff23-Apr-19 4:42 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer23-Apr-19 4:49
professionalDaniel Pfeffer23-Apr-19 4:49 
GeneralRe: Thought of the Day Pin
megaadam23-Apr-19 4:53
professionalmegaadam23-Apr-19 4:53 
GeneralRe: Thought of the Day Pin
Jörgen Andersson23-Apr-19 5:08
professionalJörgen Andersson23-Apr-19 5:08 
RantRe: Thought of the Day Pin
lopatir23-Apr-19 5:14
lopatir23-Apr-19 5:14 
GeneralRe: Thought of the Day Pin
Herman<T>.Instance23-Apr-19 5:28
Herman<T>.Instance23-Apr-19 5:28 
GeneralRe: Thought of the Day Pin
W Balboos, GHB23-Apr-19 5:30
W Balboos, GHB23-Apr-19 5:30 
GeneralRe: Thought of the Day Pin
Gary R. Wheeler23-Apr-19 11:31
Gary R. Wheeler23-Apr-19 11:31 
GeneralWSO CCC OTD 2019-04-23 Pin
OriginalGriff22-Apr-19 21:40
mveOriginalGriff22-Apr-19 21:40 
GeneralRe: WSO CCC OTD 2019-04-23 Pin
musefan22-Apr-19 22:13
musefan22-Apr-19 22:13 
GeneralRe: WSO CCC OTD 2019-04-23 - we have a winner! Pin
OriginalGriff22-Apr-19 22:19
mveOriginalGriff22-Apr-19 22:19 
GeneralRe: WSO CCC OTD 2019-04-23 Pin
Fueled By Decaff23-Apr-19 2:28
Fueled By Decaff23-Apr-19 2:28 

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.