Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Odd, I like C++/CLI but you listed exactly its features I dislike. My criticisms:
- - > [C++-style references for managed types](http://stackoverflow.com/questions/2181846/how-can-i-get-close-to-non-nullable-types-in-c-today), not as elegant as full blown [non-nullable](http://stackoverflow.com/search?q=non-nullable) references but better than nothing or using a [work-around](http://msmvps.com/blogs/jon_skeet/archive/2008/10/06/non-nullable-reference-types.aspx).
- Okay. But accidental use of the hat is pretty widespread, getting
- the value of the value type boxed without warning. There is no way
- to diagnose this mistake.
- - > templates which are more powerful than generics
- Power that comes at a high price, templates you write are not usable
- in any other .NET language. If anything, it worsens the C++ template
- export problem. The complete failure of STL/CLR is worth pondering
- too.
- - > preprocessor (this may be a disadvantage!, but macros can be useful for code generation)
- Erm, no.
- - > stack semantics for reference types--automatically calling *IDisposable::Dispose()*
- This was IMO a serious mistake. It already is difficult to avoid
- problems with accidental boxing, as outlined in the first bullet.
- Stack semantics makes it seriously difficult for any starting
- programmer to sort this out. This was a design decision to placate
- C++ programmers, that's okay, but the using statement was a better
- solution.
- - > easier implementation of *Dispose()* via C++ destructor
- Not sure how it is easier. The GC.SuppressFinalize() call is
- automatic, that's all. It is *very* rare for anybody to write a
- finalizer, but you can't avoid the auto-generated code from making
- the call. That's inefficient and a violation of the 'you don't pay
- for what you don't use' principle. Add to this that writing the
- destructor also forces a default finalizer to be auto-generated. One
- you'd never use and wouldn't want to be used if you forgot or omitted
- to use the destructor.
- Well, that's all very subjective perhaps. The death-knell will come with VS2010, it will ship without IntelliSense support for C++/CLI.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement