Microsoft's C++/CLI Spec Has an Identity Crisis 154
Andy Updegrove writes "Microsoft's submission of its XML Reference Schema to Ecma has gotten lots of attention in recent months, because Microsoft offered it to Ecma to try to neutralize Massachusetts' adoption of the OpenDocument Format (ODF) standard. But last week it's earlier submission of C++/CLI to Ecma was in the limelight when the U.K. representatives to ISO cried foul over (of all things) its name, which they said was confusingly, and inappropriately, similar to C++. Some think that there may be more afoot, including the potential for Microsoft to add proprietary extensions after ISO finally adopts the new standard under a different name. Either way, the C++/CLI experience represents an interesting dry run for what to expect as Microsoft pushes the XML Reference Schema throught the same process."
It's all in how you read it (Score:3, Interesting)
651 (DCLI)
C++ Command Line Interface
The name, as submitted, is a sufficient train-wreck that people savvy enough to know a compile shan't confuse it with something they want. Possibly it will appeal to the PHB audience.
Re:It's all in how you read it (Score:2)
Re:It's all in how you read it (Score:2)
Re:It's all in how you read it (Score:2)
Re:It's all in how you read it (Score:2)
Lawyers (which is what MSFT really cares about) care about context only in that it allows them to raise ambiguity, and say, "No, we really meant something else. Too bad, so sad you got screwed."
Re:It's all in how you read it (Score:2)
Re:Saturate, diffuse and confuse (Score:2)
VMS Record Management Services
http://h71000.www7.hp.com/doc/731FINAL/4523/4523p
Spellcheck. Please. (Score:3, Funny)
thought + through = throught != a well perused article summary.
Re:Spellcheck. Please. (Score:2)
Googling reveals the: Office 2003 XML Reference Schemas, a me-too equivalent to ODF (Open Document Format)
Re:Spellcheck. Please. (Score:2, Funny)
Re:Spellcheck. Please. (Score:2)
Sounds like a molehill masquerading as a mountain (Score:2, Interesting)
C++/CLI seems to be a (standardized) proprietary extension to the C++ language that allows it to interface well with the rest of the
On the one hand, you've got Microsoft who is willing to labe
Re:Sounds like a molehill masquerading as a mounta (Score:1, Funny)
"This doesn't seem to be anything more than someone who's got his panties in a bunch about Microsoft"
I actually think that's a pretty good analogy
Re:Sounds like a molehill masquerading as a mounta (Score:2, Funny)
Dammit!
Re:Sounds like a molehill masquerading as a mounta (Score:5, Insightful)
Compilers have no sense of humour. If a language is not ISO C++, it is not C++ and should not have C++ as part of the name. I'm dating myself, but I've worked with "FORTRAN" compilers that didn't support FORTRAN 77 (which was the standard at the time) and to all intents and purposes they were not FORTRAN compilers--they were "some proprietary FORTRAN-like-language compilers" and completely useless if you wanted to compile many perfectly ordinary FORTRAN programmes.
The issue here is that the use of the C++ name is a big marketing issue. But to apply the C++ name in any variant to a language that is not C++ is fundamentally misleading and dishonest. This is because humans are lazy and stupid, and tend to drop the modifier and think of "C++/CLI" as simple "C++"--the article points out that MS documentation has many examples of code samples labelled "C++" with no "CLI" modifier that are not, in fact, C++. They are C++/CLI.
And as I said, compilers have no sense of humour--they don't care that "C++/CLI" is "almost" C++. They see non-standard syntax and barf. So it is very important for those of us who want our code to compile and who want to be able to communicate with others to keep the name "C++" as pure as possible. This isn't being uptight--it is a purely pragmatic concern about keeping marketing droids as far from technology as possible so that software professionals can communicate with each other as clearly and unambigously as possible given the limitations we all have as human beings.
Plus Plus! (Score:2, Insightful)
The issue here is that the use of the C++ name is a big marketing issue. But to apply the C++ name in any variant to a language that is not C++ is fundamentally misleading and dishonest.
The same argument could have been advanced against the name C++ itself: "The issue here is that the use of the C name is a big marketing issue. But to apply the C name in any variant to a language that is not C [wikipedia.org] is fundamentally misleading and dishonest." Along these lines, I don't see anything wrong with something like "
Re:Plus Plus! (Score:2)
c++/cli is NOT descended from c or c++. Its descended from net. Call it net/cli if you want.
Re:Plus Plus! (Score:4, Interesting)
C++/CLI might be the name of the standard, what it means is: having a standard that defines how C++ is compiled to
C++/CLI or C++/.NET is essentially: C++. However with added tweakes like finalizers (yepp, thats not a destructor), (optional) garbage collection bublic/private classes liek in C#/Java and a mapping from primitv data types on
Further all primitive datatypes have a determined size, unlikey ISO C++ where still only char <= short <= int <=long is valid which means often that char == 1 byte and the rest is 4 bytes.
Finally a lot of typical C# (or
a typical C++ clas in
public class __gc MYClass {
!MyClass() {
~MyClass() {
MyClass() {
}
HINT: don't write new programms in C++/.NET except you need fancy stuff like templates (but I'm not sure how templates exactly work in C++/.NET
If you need to write new code in
angel'o'sphere
Re:Plus Plus! (Score:5, Insightful)
This is false. To you all the nice people who have thoughtfully replied to my comment with pedantic outrage, let me remind you what hummassa (157160) has pointed out in a mysteriously low-moderated response:
C++/CLI will not compile the STL.
This has been my own experience with C++/CLI, and one of the primary reasons for my being so hard-assed about the name. This is not a minor deviation from the standard. It is a radical deficiency. The STL is a core piece of any C++ programmer's toolkit, and any compiler in 2006 that will not compile it is not a C++ compiler, and should never be refered to as C++, and should not have a name that could possibly be confused with C++.
This is like having a FORTRAN compiler that can't handle LAPACK. If I created something called FORTRAN/CLI that couldn't compile LAPACK people would rightly yell at me. MS deserves to be smacked on the nose with a rolled up newspaper for doing the equivalent to C++.
Re:Plus Plus! (Score:2)
This is false.
OFC its not false, please stop your nitpicking.
Three are endless of C++ compilers that don't have a standard STL but their own crippled version. As others pointed out: who descides if a compiler is called a C++ compiler? The vendor!
As all your critics is right, from a language point of view C++/CLI is ofc C++
The whole reason why *I* don't use C++ anymore
Re:Plus Plus! (Score:3, Insightful)
c++/cli is NOT descended from c or c++. Its descended from net.
I'd have to disagree with that. At least if we are to consider c++ a descendant of c, than calling c++/cli a descendant of c++ could certainly be valid while calling it a descendant of
.NET is a common langage runtime, common type system, meta-data about assemblies and thier internals, etc. In a nut-shell you can consider
Boys, boys, calm down. (Score:3, Informative)
0. C++ (at one time, at least) EXTENDS C
1. moc/Qt EXTENDS C++
2. C++Builder "properties" and VCL EXTENDS C++
but
2. C++/CLI LIMITS C++ (no multiple inheritance, no metaprogramming, etc etc) -- more than it extends it (.net class libraries)
The fact is: (Score:2)
Re:Plus Plus! (Score:5, Insightful)
You're comparing apples to oranges.
Stroustrup didn't go around "casually" referring to C++ as C using a multi-million-dollar PR machine. On the contrary, he has written extensively about the relationship between C++ and C as the newer language has evolved, and has always been clear about the significance of having similar syntaxes and where the differences start.
Microsoft, on the other hand, frequently do refer to C++/CLI simply as C++. They even have a column on their MSDN web site called Pure C++ [microsoft.com]; would you like to guess whether the C++ in question is the ISO standard variety or the C++/CLI one? That one's a real shame, and I'd have expected better from a distinguished C++ expert like Stan Lippman.
Re:Plus Plus *WAS* C (Score:2)
Re:Plus Plus *WAS* C (Score:2)
Re:Sounds like a molehill masquerading as a mounta (Score:2)
Does c++.net run ansi c++ code? Then its C++
Re:Sounds like a molehill masquerading as a mounta (Score:2)
The Brits are concerned that if MS can't even keep the name straight, what's the chance of everyone else doing so. The end result will be programs that claim to be C++ programs that won't compile without MS.
Re:Sounds like a molehill masquerading as a mounta (Score:2)
?!?! Not AFAIK (Score:2)
Short answer: no. (Score:4, Informative)
Long answer: NO. C++/CLI does not have multiple inheritance; it does have generics, which are templates without the metaprogramming possibilities -- because it does not have templates. Henceforth, the STL does not work under C++/CLI. Nor does Boost.
It does have annotations on classes and methods, reference/value class dichotomy, garbage collection built-in (as opposed to library-based), finalizers (one strange kind of destructor), its generics have type restrictions (like the new templates planned for C++0x -- of which I'm not a big fan)
It's as different from C++ as is C# or Java, really.
Re:Short answer: no. (Score:2)
Yes it does [microsoft.com]. No multiple inheritance, that's true, but as for templates, they're supported just fine.
No, again (Score:2)
> That's a different matter, as implementations often need to use compiler-specific tricks.
Nope. Both the STL (as in STLport) and Boost will do fine in any ISO-compliant compiler without resorting to compiler-specific wizardry.
Re:Sounds like a molehill masquerading as a mounta (Score:3, Insightful)
What a load of crap.
C++ was well established on all major platform long before ISO standardized it. I know I've written my share of #ifdef/#define's to make code more portable between IRIX and othe *nix variants in my 15 plus years of C++ coding.
If you want to write a (mostly)cross-platform C++ program then use ISO C++. But if you want to reuse your C++ code and integrate it with newer
Re:Sounds like a molehill masquerading as a mounta (Score:1, Insightful)
You can't be too happy with those Boost guys, either, tampering with the purity of ISO C++ by adding library features.
Re:Sounds like a molehill masquerading as a mounta (Score:2)
Well, congrats and all, but maybe if you realize that Fortran is such an obstacle to meeting women, take a break once in a while.
Re:Sounds like a molehill masquerading as a mounta (Score:1, Funny)
I'm dating myself
Yes... most of us call that "single".
Re:Sounds like a molehill masquerading as a mounta (Score:3, Insightful)
So I guess there weren't any C++ compilers between 1997 when the language was standardised and some time around 2001 when the compiler vendors started catching up with the features that had been included in the spec?
Perhaps my copy of Borland C++ 4.5 from ~1994 isn't a C++ compiler at all, because the language hadn't been standardised when it was written?
Here's a clue for you: in the real world, we call a compiler a C++
Re:Sounds like a molehill masquerading as a mounta (Score:2)
What subset of C++ does it need to compile to be a C++ compiler?
Do you even care?
What if it can't compile templates or classes, is that good enough? After all, not everyone uses them.
What if it can do classes and not operator overloads? Is that still a C++ compiler?
The reason the standards exist is to help with this *real* problem -- what is or isn't a compiler for this language.
Re:Sounds like a molehill masquerading as a mounta (Score:2)
My point is that it isn't well defined. Various people might like to think that C++ means "the programming language C++ as standardised by the ISO in 1997", but in reality what people mean when they say C++ is a whole load of different things, depending on who's saying it and in what context.
The reason the standards exist is to help with this *real* problem -- what is or isn't a compiler for this language.
Yes, and that's fair enough. However, the fact
Re:Sounds like a molehill masquerading as a mounta (Score:2)
Re:Sounds like a molehill masquerading as a mounta (Score:4, Informative)
"Managed C++" or "C++ with Managed Extensions" or "C++/CLI" or "C++.net" or whatever you want to call it (Microsoft has done a very poor naming job with the entire
Re:Sounds like a molehill masquerading as a mounta (Score:2)
You're missing the point. The fact that standard C++ code can be compiled with the Microsoft compiler isn't contested. The problem is that Microsoft is presenting its version as if it were C++. That means anyone coming to C++/CLI and writing code in the style advocated by Microsoft will not be producing code that can be compiled by any other C++ compiler, though they might not understand this. That is disingenuous, and will damage those who are misled by locking them into the Microsoft platform.
Re:Sounds like a molehill masquerading as a mounta (Score:2)
In order to use any of the Microsoft specific functionality of C++/CLI (and hence be locked in to MS playforms), you are going to realize that they are
You are going to have a major deploy problem on your hands reguarding the WINDOWS platform if you write a .
Re:Sounds like a molehill masquerading as a mounta (Score:4, Interesting)
You're still missing my point. You fundamentally assume that all developers are aware of portability issues, standardisation issues, the technical details of exactly what is and what isn't in ISO C++, the nature of Microsoft's .Net platform and the C++/CLI language, and so on.
Take a look at any C++ newsgroup, preferably one of the unmoderated ones with a lot of newbies asking for help. Observe their level of understanding (or otherwise) of exactly how even standard C++ works. They frequently don't "get" concepts like undefined behaviour, compiler extensions, and standard vs. non-standard libraries. A huge number of the problems posted on such groups come directly from making that sort of mistake; some groups have dozens of examples every week. Some people will even aggressively defend their misconceptions, telling other (correct) posters that they don't know what they're talking about because "it works on my compiler". This has been happening with GCC extensions for years, and it's already happening with Microsoft extensions as well.
So yes, I'm completely convinced that there are huge numbers of new and inexperienced programmers out there who really won't appreciate the significance of tying themselves into Microsoft's platform. Moreover, it is naive to pretend that Microsoft doesn't know this very well. Their whole marketing strategy, which the BSI guys are rightly challenging, seems to be based on creating this ambiguity in people's minds. I've mentioned the "Pure C++" column and random blog post misterminology elsewhere in this thread. There are simpler things too, like highlighting C++/CLI reserved words even when you're editing native C++ code in the IDE, as if they were a part of standard C++, and including C++/CLI and .Net material prominently in help pages even when nothing implying this platform is selected in the filters.
I'm no arbitrary MS-basher -- go ahead and check my previous posts, and you'll find sometimes I support them and others I don't -- but in this case, I think they have a blatant strategy for trying to abuse the system, and it's quite right that those responsible for maintaining that system call them on it. If they had tried this with any well-known language with a major commercial backer, they would have been sued into oblivion by now, probably with a court order not only preventing standardisation under their derivative name but also preventing them from even marketing their own product with it.
Re:Sounds like a molehill masquerading as a mounta (Score:2)
So when you do a google search for "C++ programming examples" and it returns something in that strict superset, you won't mind that it doesn't compile?
Re:Sounds like a molehill masquerading as a mounta (Score:2)
for (int i...)
for (int i...)
certainly always used to not compile with the default settings, as it claimed that the 'i' variables clashed, and resulted in lots of code being written like:
for (int i=...)
for (i=...)
Re:Sounds like a molehill masquerading as a mounta (Score:2)
Re:Sounds like a molehill masquerading as a mounta (Score:2)
So when Herb Sutter posted:
"Microsoft and Gnu have both greatly improved in recent years and are both ship current compilers that are around 98-99%... conformance as measured by the major commercial test suites, which is pretty good -- good enough to build Boost and Loki without workarounds -- but EDG is the only "100% conformance" champ."
he was wrong?
Re:Sounds like a molehill masquerading as a mounta (Score:1)
There are special cases of the English language like RFC documents and legal documents where certain words like "must", "should", etc have very specific meanings. That is necessary so that the documents will have the exact same meaning to different people. In contrast poetry has no such regulations. C++ is not poetry though, and it has strict
Re:Sounds like a molehill masquerading as a mounta (Score:1)
Re:Sounds like a molehill masquerading as a mounta (Score:5, Insightful)
But the problem is that MS has taken to calling it.. C++. We already have a C++. If you look at MSDN they have C++.Net code all over the place, but they never call it that. They always call it C++. They make a C++.Net complier, but they just call it C++. From what I've read, they seem to be almost purposely trying to confuse the difference between C++ and C++.Net.
The worry seems to be that if this standard is ratified, MS will continue this practice. One can argue they have done this in the past, trying to confuse J++ and Java (J++ being their "version" of Java). While this all does seem a bit nit-picky, I think it is important.
Re:Sounds like a molehill masquerading as a mounta (Score:2)
Yes, but:
1) J++ was being pitched as a VB replacement, at a much lower programmer education level
2) Java was relatively new, the standard wasn't widely known.
I guess I'm having trouble believing that C++ programmers would be confused by this.
Re:Sounds like a molehill masquerading as a mounta (Score:3, Interesting)
Re:Sounds like a molehill masquerading as a mounta (Score:2)
Various corrections and more information. (Score:5, Informative)
It's the UK's panel that has submitted this paper to ISO; the UK panel is part of BSI, the British Standards Institute, one of the NB's (National Bodies) making up ISO.
The biggest problem is that ISO should not publish two standards which are for such different languages with such similar names, and encourage the confusion. Standards are there to reduce confusion, not to contribute to it.
And make no mistake, C++/CLI is a huge departure from the core language. It introduces a whole new type of pointer, it adds generics to C++ templates, it abandons const-correctness for core using "ref" classes, it has yet another string type (this time somewhat integrated into the language rather than being a pure library entity), it adds mandatory garbage collection (C++ has always permitted, but not required, GC, though with some caveats) in a way not consistent with previous work with GC in C++, and there's more I'm sure.
It's also a concern that C++ may wish to expand into areas overlapping with those that are covered by Microsoft's language "C++/CLI", and may not wish to do so in the same way as C++/CLI, which is mostly just one of a pile of vendor-specific extensions to C++.
ISO is about standardizing existing practice. Some of the biggest problems with existing C++ and C standards has been when they got too inventive, and accepted into the standards things that were implemented in few (or no) compilers. So far as I know, there's still only one compiler that supports C++/CLI (though I've a feeling one other company is working on one).
Microsoft and the ISO C++ groups have been getting along a lot better in the last few years; Microsoft returned to attending committee meetings, and hired some great people, both names that get publicity and some that don't. However, Microsoft is still a large company with a monopoly in certain areas, and some history of anticompetitive practices, and it seems sensible for us to tread carefully.
Re:Various corrections and more information. (Score:3, Funny)
Apparently ISO didn't get that memo:
Kilobyte [wikipedia.org]
Re:Sounds like a molehill masquerading as a mounta (Score:2)
Actually if you use any of the more powerful aspects of C++ you'll know that no, C++.net is *not* C++. For instance, as far as I know, C++.net only supports single inheritance whereas C++ supports multiple inheritance.
The biggest pro
Re:Sounds like a molehill masquerading as a mounta (Score:2)
I think you're right; however, the reason for that is the the CLR itself only supports single inheritance (except for interface inheritance). Which is a good thing. I've been using C++ for 13 years and I have needed multiple inheritance exactly once (except for, as I said, when implementing interfaces). And it was a problem that could have been worked around in other ways anyway.
In C
Re:Sounds like a molehill masquerading as a mounta (Score:2)
There are several real cases where I need it, usually for mixins, that are a pain to live without.
Re:Sounds like a molehill masquerading as a mounta (Score:2)
Re:Sounds like a molehill masquerading as a mounta (Score:2)
BadAnalogyGuy, indeed. Please, stop!
The name _is_ confusing. (Score:1, Funny)
Re:The name _is_ confusing. (Score:3, Insightful)
If they want to make it less confusing... (Score:1, Funny)
Re:If they want to make it less confusing... (Score:2)
ANSI (Score:2, Insightful)
Enjoy,
Re:ANSI (Score:4, Informative)
Re:ANSI (Score:2)
The wealth of new language facilities in C++/CLI compared to ISO Standard C++ tempts programmers to write non-portable code that (often invisibly) become intimately tied to Microsoft Windows.
This sounds a lot like Microsoft's usual business. The Garbage Collector in particular means that porting the new code to other platforms will result in memory leaks and poor performance.
Re:ANSI (Score:2)
The problem is that Microsoft make it far too easy. Far too easy by half. With JNI you feel the pain a lot more and are therefore encouraged to use Java if at all possible, which as it happens is usually not too hard because the APIs and 3rd party market is massive.
The
Cava, anyone? (Score:2)
"an interesting dry run for what to expect..." (Score:2)
Perhaps that's why open-source and community projects will ultimately win (provided Microsoft doesn't succeed in making such software wholly illegal): the community efforts are about making everyone win.
Interetingly (Score:4, Interesting)
He also chair the ISO C++ standards committee.
Re:Interetingly (Score:2)
So what? (Score:3, Insightful)
Re:So what? (Score:2)
Re:So what? (Score:2, Insightful)
Re:So what? (Score:1, Informative)
First, C++ / CLI is not compatible with C++. It's not even close. It's not a strict superset of C++, so old programs might behave differently under C++ / CLI, in much the same way that C programs can behave differently when compiled as C++. They aren't really the same language.
Second, Microsoft are misrepresenting C++ / CLI as standard C++. Their tools and their documentation lead people to believe that C++ / CLI is actually C++.
The problem is not that Microsoft have come up with an exten
Re:So what? (Score:2)
I don't know much about C++/CLI, but this is different from what I've heared before (of course what I've heared before may be wrong). Could you please post a valid C++ program which would behave different under C++/CLI?
Re:So what? (Score:3, Informative)
Well, as far as I know any C++ code compiles just fine in with C++/CLI extensions enabled.
Just last month I wrote a C++/CLI wrapper class for a large C++ codebase so our
Re:So what? (Score:3, Insightful)
Re:So what? (Score:3, Funny)
You don't? Obviously you've never read comp.lang.c.
Re:So what? (Score:2)
So long as we hadn't experienced monopoly-powered embrace and extend before, I don't think we'd be so worried.
But they don't, and we have.
Justin.
Re:So what? (Score:2)
Re:So what? (Score:1)
Link to Groklaw (Score:5, Informative)
Stroustrup's comment [att.com]. Apparently Microsoft is revising their documentation to clear up the confusion.
I'm glad people are complaining about this. (Score:4, Informative)
For example, Qt introduces signals and slots as an extension, but the same effect can be achieved with libsigc++ or boost::signals, making intelligent use of the template system. Smart pointers and garbage collection have been demonstrated by boost::shared_ptr and so on.
I understand that in the past weaknesses in implementations of C++ made some of these extensions necessary, but now that we have compliant compilers that actually implement almost all of the language standard, there are less and less reasons to create proprietary extensions to it.
Re:I'm glad people are complaining about this. (Score:3, Interesting)
Re:I'm glad people are complaining about this. (Score:2)
Trolltech themselves have stated that the reason they use a preprocessor instead of a template-based system is for compiler compatibility, and not any functionality that is gained.
and the problem would be??? (Score:2)
I fully expect them to "add proprietary extension". Why shouldn't they? Almost every language in existence has had "proprietary extensions" added to it after its standardization. That's a good thing. It's the way languages evolve. Eventually, some of those proprietary extensions themselves become standardized.
Even when Microsoft is the company doing the extending, it doesn
Re:and the problem would be??? (Score:2)
Now, a lot of compilers don't 100% support the standards, but most come close. This means that code written to the standard that compiles on one
Re:and the problem would be??? (Score:2)
You mean like how VS2K5 has
Re:and the problem would be??? (Score:2)
I don't think language standards are a myth. Quite to the contrary, language standards are very important. It is a disgrace that Sun first promised, and then failed to deliver, a language standard for Java.
Sun's myth is that language standards require enforcement, and/or that language standards should prohibit proprietary extensions.
The problem is that there is
But then how about javascript? (Score:2)
There must be tons of PHBs who lump java and javascript together and make many stupid decisions as a result.
C++/CLI supports templates, people! (Score:2)
Yes, yes it does - it just happens to support generics also: straight from MSDN [microsoft.com]. Templates, being strictly a compiler phenomenon requiring no post-compilation support from the runtime, are supported just fine. The only real C++ feature that isn't supported is multiple inheritance (with the exception of interface implementation). And t
Re:C++/CLI supports templates, people! (Score:3, Insightful)
It sure as hell isn't fine with me. I use multiple inheritance a lot, and if Microsoft's language doesn't support it, that means I would have to throw away (or at least, radically redesign) most of my existing code in order to use their compiler. The whole point of having a standardized language specification is so that you can migrate existing code without
Re:C++/CLI supports templates, people! (Score:2)
And gratuitous use of multiple inheritance is bad design, so you might want to think about that. Yes it's a good thing sometimes, but this is VERY RARE - it always increases complexity and can cause problems later, it's just that sometimes the benefits are worth it. Usually not, though. Anyway, I'm not getting into that right now.
Re:C++/CLI supports templates, people! (Score:3, Informative)
Right, I could use a cross-language interface layer, the same as if I had written the code any other non-compatible language. Which is the point: Without MI, C++/CLI is not C++ in any meaningful sense of the term. It's a separate, similar-but-incompatible language, much like C# or Java.
And gratuitous use of multiple inheritance is bad design, so you might want to thin
A couple of comments (Score:2)
Second, the official objection is only to the name, not the idea or implememtation of the language itself. In case somebody wants to hear the story more or less directly fr
Re:Good for PHBs, bad for maintaince programmers (Score:2)