views:

1033

answers:

9

Reading the reviews at Amazon and ACCU suggests that John Lakos' book, Large-Scale C++ Software Design may be the Rosetta Stone for modularization.

At the same time, the book seems to be really rare: not many have ever read it, and no pirate electronic copies are floating around.

So, what do you think?

+7  A: 

I've read it, and consider it a very useful book on some practical issues with large C++ projects. If you have already read a lot about C++, and know a bit about physical design and its implications, you may not find that much which is terribly "new" in this book.

On the other hand, if your build takes 4 hours, and you don't know how to whittle it down, get a copy, read it, and take it all in.

You'll start writing physically better code quite quickly.

[Edit] If you want to start somewhere, and can't immediately get a hold of the book, I found the Games From Within series on physical structure useful even after reading Large Scale C++ design.

MadKeithV
Many thanks for the link.
mlvljr
+2  A: 

It's a little out of date (in fact it was out of date when it was written).
IIRC a lot of it was about reducing dependancies which you would probably do now with templates.

Although that's probably one of the lessons to learn on large scale projects, you aren't usually using cutting edge features and tools.

Martin Beckett
If there's one thing I would NOT do it's using templates to bring my physical dependencies down, or hoping that it would reduce build time. You really do not want heavy template use in large projects with current compilers - they slow things down a lot because every usage needs access to the full template.The pimpl idiom on the other hand is something that I believe _should_ be used heavily in large-scale projects.
MadKeithV
+5  A: 

Lakos used to work for Mentor Graphics, who make EDA software. He was involved in building EDA software in C++, where they wanted to use C++ efficiently ('no more than 5% overhead over C code') and sort out how to build software on early workstations that really would take a long time to compile a large C++ app.

The book is quite a good read - it discusses a wide variety of topics, and Lakos really did know his stuff. He really comes from a background of having to get efficient code out of a C++ compiler, as well as how to set up a C++ program so it is maintainable and compiles and links reasonably quickly.

I think that Lakos has a lot of insight and I would recommend that you read it. However, it is 'trad' C++ from a time before features like templates were widely available. My copy is not for sale ;^)

ConcernedOfTunbridgeWells
@"My copy is not for sale" I knew it! :)
mlvljr
C++ is no longer flavour of the month so you can probably get a secondhand copy quite cheaply. Amazon Marketplace is your friend ;^)
ConcernedOfTunbridgeWells
+1  A: 

Yes, in some ways, the book is a little dated and some of it is C++ specific. Nonetheless, it offers a lot of useful advice about dealing with complexity and coupling in large programs, and most of his advice applies to any object-oriented language. I also found it very readble. If you can track down a copy, I'm sure you'll find it worth reading. It's in my top ten list of programming books.

Stephen C. Steel
+1  A: 

I read it a long time ago but remember getting quite a lot from it; though as MadKeithV points out, that may just have been that I knew less then ;)

Certainly from a "how do I reduce how long this takes to build" perspective it's has lots of useful stuff, especially around reducing compile time dependencies, though possibly some of it is no longer relevant, or even possible, given how much templates are used these days.

And no, you can't have my copy either :)

Len Holgate
+2  A: 

Is “Large-Scale C++ Software Design” by John Lakos a mind-provoking (but usually overlooked) gem?

Yes.

Robert Grant
Thank you :) Upvoting.
mlvljr
Haven't they also got there an article on leading answers?:)
mlvljr
+1  A: 

It is an excellent book and an important one from a historical point of view.

Note that to implement the practices described in the book, you need considerable discipline and agreement within the team. Here are a few things to note:

  1. Lakos has precise definitions for what he calls "components" and "packages". These are key for large scale design. However, they require adherence to conventions for how source and header files are named and the sequence in which they are included. It is a shame that most people (including those who quote Lakos) rarely follow these conventions.

  2. The book is all about C++ but the concepts are more widely applicable. However, because C++ is such a complex language, a large part of the book is teaching you how to use C++ effectively. If you can get past that, you can actually find it useful even if you use other languages.

  3. Some of the prescriptions such as on the use of "name spaces" maybe considered controversial now. Many believe that name spaces should be used in a limited way in C++.

Neeraj Sangal
+1  A: 

I want to add to all this answers that it is only usefull for C because this language has the problems with the header hell. Some advises are pretty useless today, like include guards which are now done by the compiler or grouping of headers when you better use a few precompiled headers (one for each package).

If you ask me if it is worth buying then i answer: Only if your are a beginner in C/C++ development. The current problems of todays C++ world (templates and templates and did i already mention templates) are not meet.

But i just looked at the book again, gives me nice memories and tells me again why this langauge is simply so absolutely wrong and needs to be replaced.

Lothar
...with what [language]?
mlvljr
For me it's Eiffel - but it is not a silver bullet and i'm not sure if it would scale to millions of lines. In this case i would switch to Ada. Yes i'm a strange guy :-)
Lothar
+4  A: 

Interestingly, "More C++ Gems" contains a shortened (to 88(!) pages) version of Lakos' book, which can also be browsed (fully, I believe, as it belongs to the first half of the book) online at Google books.

So, enjoy everyone interested:)

mlvljr