Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,187 of 33,346    |
|    Martin B. to Dave Harris    |
|    Re: Simple (Re: Initialization and trivi    |
|    24 Apr 12 01:06:08    |
      From: 0xCDCDCDCD@gmx.at              On 23.04.2012 23:39, Dave Harris wrote:       > 0xCDCDCDCD@gmx.at (Martin B.) wrote (abridged):       >>> Basically, assignment statements are simple. Everyone understands       >>> them. Initialisation lists are weird and full of restrictions and       >>> special cases; they are part of what makes C++ hard. Sometimes you       >>> need them for performance, though.       >>       >> I'll answer to this in semi-rant mode, as it seem to be a common       >> theme with C++. (It certainly is common where I work, also when       >> discussing with some friends.):       >>       >> And I can't hear it anymore! C++ is a professional tool, and we       >> should use the language to it's full potential, and not limit       >> ourselves to what "everybody understands". The *whole* dang language       >> is "weird and full of restrictions", and still there we are using       >> it, because one or the other reason!       >       > I think this is missing the point. There is no benefit to making code       needlessly       > complicated. Prefer simplicity. The issue here is, which is simpler? I've       mentioned       > ways in which constructor initialise lists are more complicated. Are those       > complications worth it?       >              There are some things needlessly complicated, but surely, initializer       lists are *not* among them.              Initializer lists are only "more" complicated -- if at all -- for some       special cases of initialization. (That were mentioned.) Then again, you       must use them in some other cases anyway.              So, I agree that *the existence* of initializer lists in the C++       language is a (syntactic) complication.              Once they exist, they are equivalently complex (to read and write) than       constructor initialization code - and the devs have to know them anyway,       so, as others argued, I guess *using them* when possible will lead to       *more consistent* code.              cheers,       Martin              --       Good C++ code is better than good C code, but       bad C++ can be much, much worse than bad C code.                      [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca