Click here to Skip to main content
15,890,399 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
OriginalGriff23-Apr-19 5:57
mveOriginalGriff23-Apr-19 5:57 
GeneralRe: Modern C++ auto Pin
GuyThiebaut23-Apr-19 6:39
professionalGuyThiebaut23-Apr-19 6:39 
GeneralRe: Modern C++ auto Pin
Theraot24-Apr-19 1:35
Theraot24-Apr-19 1:35 
GeneralRe: Modern C++ auto Pin
dandy7225-Apr-19 9:42
dandy7225-Apr-19 9:42 
GeneralRe: Modern C++ auto Pin
GuyThiebaut23-Apr-19 6:44
professionalGuyThiebaut23-Apr-19 6:44 
GeneralRe: Modern C++ auto Pin
Maximilien23-Apr-19 7:14
Maximilien23-Apr-19 7:14 
GeneralRe: Modern C++ auto Pin
David O'Neil23-Apr-19 11:19
professionalDavid O'Neil23-Apr-19 11:19 
GeneralRe: Modern C++ auto Pin
Dean Roddey23-Apr-19 7:58
Dean Roddey23-Apr-19 7:58 
It is getting stupid, but then again much of modern C++ is some sort of attempt to try to make it into exactly what it really isn't. It's like we've been infected with people whose idea of software is a javsascript web site.

When you are righting serious code that you will have to support and upgrade over decades, being as explicit as you can is always a good thing. You'll write it once, but you'll have to read and modify it many, many times. Auto makes it way too to make silent mistakes during modifications, because it just takes on whatever you assign it. If the type you wrongly assign is syntactically similar enough, and that's not hard to happen given how much people do with operators and other templates and such, it will just silently change the code.

If you explicitly indicate the type, you have to screw up two different ways as once, which just makes it that much less likely to happen silently.
Explorans limites defectum

GeneralRe: Modern C++ auto Pin
Dean Roddey23-Apr-19 15:50
Dean Roddey23-Apr-19 15:50 
GeneralRe: Modern C++ auto Pin
Rage23-Apr-19 20:46
professionalRage23-Apr-19 20:46 
GeneralRe: Modern C++ auto Pin
Andy Hoffmeyer24-Apr-19 4:14
Andy Hoffmeyer24-Apr-19 4:14 
GeneralRe: Modern C++ auto Pin
wheelman570z24-Apr-19 7:11
professionalwheelman570z24-Apr-19 7:11 
GeneralRe: Modern C++ auto Pin
Andy Hoffmeyer24-Apr-19 7:41
Andy Hoffmeyer24-Apr-19 7:41 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 7:55
Dean Roddey24-Apr-19 7:55 
GeneralRe: Modern C++ auto Pin
Rick Shaub24-Apr-19 9:33
Rick Shaub24-Apr-19 9:33 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 10:00
Dean Roddey24-Apr-19 10:00 
GeneralRe: Modern C++ auto Pin
Rick Shaub24-Apr-19 10:05
Rick Shaub24-Apr-19 10:05 
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 

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.