Tech Off Post

Single Post Permalink

View Thread: Andrei, Herb and Scott: Got C++11 Questions?
  • User profile image

    Build Model. 

    Are there any ideas or even plans  to improve? 

    I see it as the biggest issue in C++ for large projects. 

    The separation of header and body is purely to "make the tool chain happy". A typical header contains both interface and implementation details  -  to avoid that I have to write more code.  The separaton is awkward from a software design POV. Header-only code lacks certain features (static variables), and is suitable only for stable libraries, as incremental build times usually suffer massively. 

    #include's go stale after ever so many refactorings, unused #includes are hard to identify, creating a spaghetti bowl of fake dependencies that are hard to understand and harm incremental build times - which in turn harms the entiredevelopment process. Slow turnaround means slow tests means tests are run less often. Large projects often suffer from bugs / shortcomings of the dependency check, triggering full builds "just to be sure".  

    Moooar hardware, forward declarations, precompiled headers and PIMPL can mitigate the problems only up to a point.  The latter makes me particulary uneasy: solving a tool chain problem by changing the way I write code.


    Anyway, looking forward to the talk!