Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Kang Su Gatlin - The power of C++ in the managed code world

Download

Right click “Save as…”

Kang Su Gatlin, program manager on Visual C++, talks about the challenges that Visual C++ programmers have when moving to the managed code environment of .NET.

He also discloses that Visual C++ developers can use both managed and unmanaged code in their projects.

Tag:

Follow the Discussion

  • Wow, time to for me put C# on hold and dust off the old college C++ books.
  • William Staceystaceyw Before C# there was darkness...
    Sounds like you can do most of the same things with unsafe methods in c#.  Naturally, c++ will allow closer access to win32 api and memory structs where c# would still require pinvoke.  I still would not give up my c# for this.  Unless I needed some real funky code block in c++, or some real perf concern.  However have not really come across that yet.

    --
    William, mvp 
  • WinInsiderWinInsider Mike, MCAD

    Another advantage of MC++/CLR that Kang mention in another video is optimization that C++ team made on CLR compiled code.  Thus, it should not be surprising to see MC++ outperform equivalent C# code (or VB.NET for that manner).

  • William Staceystaceyw Before C# there was darkness...
    The compiler outputs IL and the jitter compiles IL to native - no?  So at the point the jitter don't know if lang was c++, vb, c#, etc.  Maybe I am missing something.  It could be the c++ compiler produces better IL, but I don't think in general it would be much different then what c# or vb would produce - or am I wrong?  Cheers!
  • KSGKSG
    The compiler does generate different IL.  Here's a simple example of something VC2005 does that no other compiler does.  If you have two source files: A.cpp and B.cpp.  A.cpp has a function which calls a function in B.cpp.  VC2005 can inline this function with LTCG (Whole Program Optimization).  No other compiler does this.

    I love C# also, but C++ has made performance one of our key goals.



    Kang Su Gatlin
    Visual C++ Program Manager
  • rasxrasx Emperor of String.Empty
    I have always avoided C++ because it was not originally designed for object oriented programming and my high-level, data-centric solutions made the need to manage memory by hand almost bizarre in such a non-printer-driver context.

    However, this ability to switch memory management on and off on a member-by-member basis gives me pause. But in the mean time I press play and get C# under my belt.
  • I am a C++ guy trying to get my head around the .Net world.  I have not been able to find much information on how to get up to speed on managed C++.  Any suggestions.  Recommendations on online resources, books, or magazine articles would be helpful.  Thanks!

  • KSGKSG
    Hi Haroon,

    There are several places where you can learn about managed C++.  Probably the best place to start is at: http://msdn.microsoft.com/visualc

    If you look in "Other Resources" there is the C++/CLI new language specification.  If you look under multimedia there is a webcast series on "The New C++". 

    Also some of the blogs on the page, such as Stan's are simply great. 

    Both of these resources focus on the new C++ that we'll be showing in VS2005 (and available in VS2005 Beta1!!). I highly recommend using this new syntax if you don't have a product that you need to ship this year.  The new language looks better, is cleaner, and is more powerful. 

    I would also recommend this webpage:
    http://codeguru.com/Cpp/Cpp/cpp_managed/

    I'm a big fan of Kate Gregory's articles here.  I've never read her book on C++, but I'm sure it is also quite good.  Richard Grimes's book on Managed C++ is also good.  Now what Kate and Richard write about is the old managed extensions.  The syntax there is simply ugly.  But they're great resources to learn about things such as Interop, which is one of the many areas where C++ excels.

    If you have any more questions feel free to ask.

    Kang Su Gatlin
    Visual C++ Program Manager


  • AutocratAutocrat Matty

    Okay, so I have done quite a bit of game development and one of the things that we see in the game development industry is that everyone is using c++ and a mix of assembler over any other language / implementation.  The reason for this has been (and more than likely will always remain) that the speed and efficiency of c++ is undoubtedly unbeaten in any other implementation.

    So having brought this into the picture, can you see any benefits for a game developer to use the CLR switch?  Quite frankly I think that managed code is definitely a developer oriented advantage - it allows us to speed up the development process, but not necessarily the speed and execution of our code.  I am not really sure I can see any advantages in this scenario of mixing managed code with a native implementation other than speeding up developer time.

    I always feel as though any developer who needs pure speed and power is going to go for a native approach, do you see this as being a fading trend as we approach longhorn? Or is this going to remain true for this type of industry where speed is everything?

    (Note: this post is completely ignoring managed directX, and the benefits it may or may not have for game developers -- I have not got any experience with it or seen any benefits or speed benchmarks)

    Regards,

    Matthew Cosier
    Microsoft Australia

  • KSGKSG
    Hi Matthew, in the game industry I think there is a space for managed code.  In programs like Doom3, which are cutting-edge engines, you probably won't go to managed code very soon.  But I can imagine some of the real-time strategy type of games moving to managed code. 

    But I'm not a game developer, so this is just the opinion of a compiler guy.



    Thanks,

    Kang Su Gatlin
    Visual C++ Program Manager
  • Big Smile:D:D

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.