|go ahead... be a heretic|
Two Different Languages: Two Similar Books (PBP and CCS)by eyepopslikeamosquito (Archbishop)
|on Oct 16, 2005 at 13:07 UTC||Need Help??|
Perl and C++ are very different programming languages. Nonetheless, I use both regularly and recently had the pleasure of reading two similar books about each:
Personally, I was delighted to see these two books appear. For Perl and C++ are both mature, TMTOWTDI languages and now is an opportune time to reflect on the hard won experience of the past 10 years and lay down the law on how best to utilize these complex languages. Doing so clearly and with authority -- as both these books do -- is especially beneficial to programming teams suffering chronic maintenance and teamwork problems at the coal face.
This meditation compares and contrasts these two fine books.
PBP contains 256 guidelines and weighs in at a whopping 542 pages. CCS weighs less: 101 guidelines, 240 pages.
Why is PBP bigger? It covers more ground, with excellent chapters on documentation, testing and debugging -- missing from CCS. Further, PBP is more self contained than CCS, convincingly explaining the rationale behind each guideline in detail, and with fewer external references. Finally, PBP on occasion invents new art, such as unveiling a suite of funky new CPAN modules authored by TheDamian (as if you couldn't guess;-). CCS, on the other hand, deliberately eschews invention. And strives to keep guideline rationales short, often by providing references to external material.
Though longer, PBP is missing a few nice tips from CCS, such as guidelines on concurrency/threading, error-safe code, automated builds and code reviews.
Generally, PBP emphasizes "Robustness, Efficiency, Maintainability", while CCS seems more concerned with "Correctness, Simplicity, Clarity, Safety" along with "uniformity in the right dimension" and "creativity in directions that matter".
Another conspicuous difference is Conway's gutsy attempt to persuade readers on code layout issues, such as space versus tab indentation and braces placement. Personally, I applaud Conway for this (though doubtless others booed). In any case, I found Damian's carefully reasoned arguments convincing. In contrast, CCS's first guideline, Don't sweat the small stuff, timidly exhorts its readers not to attempt to enforce personal taste on code layout.
As for similarities, both books, in addition to language specific recommendations, offer general guidelines applicable to either language; both books, for example, extol the virtues of version control. In addition to specific similar guidelines (detailed below) both books emphasize similar general principles, such as scalability, abstraction, encapsulation, and preferring to find errors at compile time rather than run time.
Conway and Alexandrescu: Separated at Birth
At first glance, Conway and Alexandrescu seem spookily identical:
On second glance, admittedly, there are some glaring differences:
Some Similar Guidelines Found in Both Books
Extra Tips That Might Be Added To PBP From CCS
Extra Tips That Might Be Added To CCS From PBP
What Might Be Added To Both Books
Updated 19-oct: A few extra tips plus minor improvements to wording. 23-oct: added more references. 20-jan: added opening `/anick quote.