8c90c26f   
   From: brangdon@cix.co.uk   
      
   s.gesemann@gmail.com (SG) wrote (abridged):   
   > From: SG    
   > Date: Sat, 14 Jan 2012 13:48:38 -0800 (PST)   
   > On 14 Jan., 03:33, hanukas wrote:   
   > > On Jan 12, 9:49 pm, Andrew wrote:   
   > >   
   > > > The new features in C++11 are very welcome but I think they   
   > > > won't change this basic situation.   
   > >   
   > > > So what do people think will keep C++ going?   
   > >   
   > > The need for speed (with side-effects).   
   >   
   > If we're simply talking about execution performance, there's also C.   
   > But to those who consider themselves rather proficient in C++ and   
   > know how to use it efficiently, C++ is more appealing than C.   
      
   The claim now is that although C++ code is harder to write than other   
   languages, efficient code is easier to write in C++. (Paraphrasing Herb   
   Sutter quoting Andrei Alexandrescu.)   
      
   I think it's certainly true compared to C, which doesn't have templates   
   and many other static, compile-time tools that help with making fast,   
   correct code. I don't know about compared to languages like Fortran or   
   Lisp. I suspect some academic system languages could be fast and easy if   
   they had the resources put into optimisation that C++ has had.   
      
   I included the full chain of quotes because, ironically, the C++11   
   features are an important part of why C++ is now both efficient and easy.   
   Notably lambdas and move semantics.   
      
   C++ has had things like std::for_each<> for yonks, and we all admire the   
   academic reasons but no-one actually used it because it was too much   
   effort and it only encapsulates one line of code. Now, with lambdas, it   
   is no longer too much effort. And it can lead to faster code because it   
   is easier for a compiler to optimise std::for_each<> than a for-loop,   
   because it is knows exactly what the former is doing. With the latter, it   
   has to analyse the loop body to make sure nothing messes with the loop   
   variable.   
      
   -- Dave Harris, Nottingham, UK.   
      
      
   --   
    [ 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)   
|