B
Ben Voigt [C++ MVP]
Larry Smith said:You're using the term "complement" very loosely however. I could just as
well say that VB complements C++ on the GUI side. The real issue for me
however is the very presence of two languages. It makes the entire process
of developing software inherently more complicated and expensive.
I respectfully disagree. It's quite useful to have tailored languages to
particular tasks, as long as the integration effort is low. Just because a
program needs to call some library that must be implemented with assembly
language (like Interlocked* functions), should the entire program be forced
into assembler? Of course not. regexes in C++ are ugly, much better to
use perl for that. Child process automation in C++ is ugly, much better to
use tcl/expect for that.
C++/CLI is a quantum leap forward in this respect because it exposes the
native power of raw C and assembler to a managed environment, and it does so
*easily*. Compare the effort needed to make a .NET component in C++/CLI vs
creating a Java JNI, TCL extension, Perl binary module, etc in C or C++.
I've heard Lua and Ruby are the other high level language that integrates
very well with C, and I doubt even they make it as trivial as C++/CLI.
For example:
void asmbreak( void )
{
__asm int 3;
}
public ref class Fragile
{
public:
static void BreakMe() { asmbreak(); }
};
What's that, under 30 tokens (not counting the assembly itself) to make any
assembler code available to a C# or VB.NET or JS.NET or F# or Eiffel.NET
program?