Wednesday, November 10, 2010

TOC shaping up ...

Obviously this stuff's still in flux, and will be until published, never mind these early phases. Nonetheless, it's shaping up more and more clearly in my mind, currently looking as:

  • Part 1 - Introduction, covering foundational subjects, including:
    • The Mythe of the Software Nirvana
    • Defining Software Quality
    • Principles of (UNIX) Programming
    • Monolith Hunting  
  • Part 2 - Why C++
    • The C-Family, or You Can't Pick Your Relatives
    •  Nul-Termination
    • Paradigms at War
    • Backwards Compatibility?
    • Operator Underload
    • C How Much Trouble You Got Us Into 
    • it'll also contain the definitions of the (currently 10) specific technical problems that will be addressed in the book:
      • Hello, World
      • Support Free Speech: Ban all the Dissonance!
      • The Chevron Shemozzle
      • The Erroneous Apprehension of Error, or What Did I Do Wrong?
      • The Logging Conundrum
      • How To Be Yourself
      • InCOMpatible Models
      • Taming The SYSTEM
      • Bulk Billing
      • Big and Wide and Tall
  • Part 3 - Abstraction
  • Part 4 - Conformance
  • Part 5 - Heterogeneity
  • Part 6 - Failure
  • Part 7 - Diagnostics
  • Part 8 - Resource Management
  • Part 9 - Performance Compromises
  • Part 10 - C++0x
  • Appendix A - Well-known Shims
  • Appendix B - Type Tunnel Incarnations
Planning to do a chunk of work over the w/e, so there may be more news soon. To those following, thanks for your interest. :-)


Saturday, November 6, 2010

New TOC nearly ready

The Table of Contents is currently being finalised as I write this. Currently looking like the chapters will be distributed within ten parts, plus two appendixes:

  • Part 1 - Introduction. Covering:
    • The Mythe of the Software Nirvana
    • Defining Software Quality
    • Principles of (UNIX) Programming
    • Monolith Hunting
  • Part 2 - Why, C++? Covering:
    • The C-Family, or You Can't Pick Your Relatives
    • Nul-Termination
    • Paradigm Wars
    • Backwards Compatibility?
    • Operator Underload
    • C How Much Trouble You Got Us Into 
Part 2 will also include the 10 problems that will be exercised throughout the remaining parts of the book

  • Part 3 - Abstraction
  • Part 4 - Heterogeneity
  • Part 5 - Conformance
  • Part 6 - Failure
  • Part 7 - Resource Management
  • Part 8 - Diagnostics
  • Part 9 - Performance Compromises
The precise contents and order of these parts is still being planned

  • Part 10 - C++0x. Who knows what this'll contain? I do know that it'll look critically at what parts of C++0x will help address some of the problems already discussed, and what others fail to help at all. (Like, as I strongly suspect, variadic templates; more info soon ...)

Thursday, November 4, 2010

"New" Preface

In what may be becoming the longest lead-up to any written work in the history of non-fiction, I've now written a "new", and hopefully final, form of the Preface for Breaking Up The Monolith, thanks, in large measure, to the succinct advice from Scott Meyers. (Thanks go to Scott not only for his wisdom, but also being prepared to say it to me multiple times, at least once for each book. You'd think I'd learn, no?!)

The new/final Preface is, get this, 3.5 pages! And it took me only a few hours to write. If I knew it would be that easy, I'd have done it earlier. ;-)

Wednesday, November 3, 2010

Keep relearning those lessons ...

A couple of weeks ago I said that I'd completed the Preface, after a huge amount (literally years) of trying to do so.

Sadly, it appears I spoke too soon. For not the first time in my writing career, Scott Meyers has sagely reminded me that I have a tragic tendency to conflate my introductory materials. So I've now printed Scott's essential gnome, along with a few other motivational items, and stuck it on the shelf directly above my right-hand screen.

So, lest I forget:

I'm now reworking the much-trumpted Preface into an introduction, and am writing a new, small, simple, on-point Preface.

Hopefully this one won't take five years ...

Thursday, October 21, 2010

Breaking Up The Monolith: Coming at last ...

Yesterday, after four years of vacillation and procrastination and occasional modification, I finally got the Monolith preface into a form  with which I'm happy.

Over the next few days I'll be talking to the editor and contacting all those kind, smart folks who've previously agreed to be a reviewer. As soon as things are sorted, I'll start posting what bits I can, probably starting with the book's Manifesto and Preface.

Watch this space ...

Saturday, June 5, 2010

Breaking Up The Monolith: Vapourbook?

Well, any potential readers would certainly be within their rights, after more than four years of planning and talking, to think that Breaking Up The Monolith: Advanced C++ Design without Compromise, was exactly that: nothing more than hot air.

The good news for anyone that still cares is that:
  1. There's only one technical aspect of the book - the application of the Handle::Ref+Wrapper pattern to file fa├žades - to be worked on, and that's germane to a project I'm current undertaking, so it's two birds with one stone. Every other technique (including other applications of HRW) has now had several years of successful commercial use and is proven. So I guess there was something positive about my glacial pace, after all.
  2. I'm now confident of my workload for the next four months, meaning that I can plan for specific chunks of time to be dedicated to the writing of Monolith.

This is the best chance of getting it over the line I've had in over three year. If I don't succeed this time I really will deserve to lose all my readers!

Fingers crossed.


Friday, March 5, 2010

VOLE breakthrough: Type Tunneling for COM Automation

VOLE is a library for driving COM Automation servers from C++ in a robust and highly-expressive form, with natural syntax, as in:

vole::object search = vole::object::create("recls.COM.FileSearch");
collection   files  = search.invoke_method<collection>(L"Search", rootDir_, pattern_, flags);
{ for(collection::iterator i = files.begin(); i != files.end(); ++i)
 using std::string;
 string path = (*i).get_property<string>(L"Path");
 string drive = (*i).get_property<string>(L"Drive");
 string directory = (*i).get_property<string>(L"Directory");
 string dirPath = (*i).get_property<string>(L"DirectoryPath");
 string srchRelPath = (*i).get_property<string>(L"SearchRelativePath");
 string uncDrive = (*i).get_property<string>(L"UNCDrive");
 string file = (*i).get_property<string>(L"File");
 string shortFile = (*i).get_property<string>(L"ShortFile");
 string fileName = (*i).get_property<string>(L"FileName");
 string fileExt= (*i).get_property<string>(L"FileExt");

 long size = (*i).get_property<long>(L"Size");

 bool isReadOnly = (*i).get_property<bool>(L"IsReadOnly");
 bool isDirectory = (*i).get_property<bool>(L"IsDirectory");
 bool isLink = (*i).get_property<bool>(L"IsLink");
 bool isUNC = (*i).get_property<bool>(L"IsUNC");

 SYSTEMTIME crTime = (*i).get_property<SYSTEMTIME>(L"CreationTime");
 SYSTEMTIME modTime = (*i).get_property<SYSTEMTIME>(L"ModificationTime");
 SYSTEMTIME lastAccTime = (*i).get_property<SYSTEMTIME>(L"LastAccessTime");
 SYSTEMTIME lastStChgTime = (*i).get_property<SYSTEMTIME>(L"LastStatusChangeTime");

 collection dirParts = (*i).get_property<collection>(L"DirectoryParts");

As you can see, there's a good amount of flexibility in the return types available, and these can be extended by the user (via return type traits).

Up to (and including) version 0.6 of VOLE, this flexibility was only available for return types; argument types were restricted to those types compatible with the conversion constructors of comstl::variant:
  • bool
  • int8_t
  • uint8_t
  • int16_t
  • uint16_t
  • int32t_t
  • uint32_t
  • int64_t
  • uint64_t
  • float
  • double
  • CY
  • char const*
  • wchar_t const*
As an example of the Type Tunnel pattern,VOLE has always been going to appear in Breaking Up The Monolith. However, for a long time I've been pondering the presentation, in particular thinking of various options to get around the limitations of the particular Type Tunnel variant - interface mechanism: N-ary Function Templates + tunnel mechanism: Conversion Constructors - used in VOLE.

I've had various ideas, all with unpleasant aspects, of how to get around this and add more flexibility over the months and years during the (glacial) progression of Monolith. But to not much avail.

At the moment I'm trying again to put some momentum back into Monolith, and am almost at a point where the Preface+Prologue are complete, and I can make a formal proposal. A couple of days ago I was reworking the chapter on VOLE, with the hope of using it as one of the sample chapters, and had something of a revelation on the arguments flexibility issue. Very pleasingly, I've found a clean and extensible way to provide all the flexibility required. You'll be able to read about it in the book, hopefully before the end of this year!