Let's pretend we have a new evolution of C++ that let's us be more effective (intentional reference to a Scott Meyers book here). Let's call it C++ - C, or C' (hmm C Prime seems to be taken), or how about E++ (that's kinda taken too), too bad for someone. I'll go with C'' (C-Prime-Prime), for now, but I like C Prime better.
C'' supports:
- Object-oriented and other class-based development techniques
- Inclu[de]-sion of other declarations classes by name instead of header file
- Templates and all other C++ goodies we know and love
- #define (fewer pitfalls for programmers to fall into)
- Global variables (reduce coupling in classes and modules)
- Loose procedures and functions (only supports class methods, increases potential for achieving cohesion)
Screeeeetch! Contradiction. The past two "feature" sets are mutually exclusive. Aren't they? Okay, obviously, I have a trick up my sleeve or some nasty kludge to hit you with.
Not really. If our goal is to utilize and leverage the strength of the C++ language and tools, then let's do so. If we devise a C-prime-prime "compiler" to take as input our C-prime-prime file, and then output a C-plus-plus file, we simultaneously realize a number of significant benefits:
- Permit a more efficient, header-less coding style
- Allow us to restrict ourselves to the desired OO- programming idioms, while ridding ourselves of trouble-laden C idioms
- We can re-use and leverage all existing C++ tools, processes, methodologies, build environment to build our binary executables
- We support legacy C/C++ code side-by-side with our C'' code
C'mon, this is so easy. Has anyone done this before?

A note about the name. I like C Prime because it has the reference to a Calculus derivation. Is it a derivation, though? I'm not sure, it's certainly a subset, but this idea /is/ derived from C++. I'd be interested to hear ideas and thoughts about naming.
ReplyDelete