TheChaseMan's Frenetic SoapBox

Always looking for better ways to do things...

My $.02 on C# vs. C++

Eric Gunnerson has a couple of interesting posts (first, second) about C++ versus C#. I develop almost exclusively in C# these days, and I LOVE it. Years ago, C++ was a must for development on the job at CADTEL - mainly doing simple Windows API and programming against the AutoCAD API uisng Visual C++ (NOTE: this in 1995. Nowadays, there is even a .NET AutoCAD API so you can use C# for that today as well!). Since I left CADTEL in 1997, I've also written some Win32 DLLs in VC++ for creating custom Webbots in an older version of FrontPage, wrote a few ISAPI filters, and played around with ATL, and binary DHTML behaviors (which you can also create in VB). Although everyone knows that you can do just about anything with Visual C++, I found it to be very complicated for windows programming. My motto in the 90s was, "if I can't do it with VB, I'll use Visual C++." Fortunately, I pursued Web (ASP) development for the most part and all of object libraries I had to write for use in MTS/COM+ could be written in VB.

That being said, let me list based on my limited experience as a VC++ developer, what I agree with in the guru's (Eric Gunnerson) blog posts:

  • The "Code == Component" section. I hated dealing with IDL and importing from type libraries. Enough said.
  • Language Complexity - VC++ is much more difficult to work with.
  • Events - my VC++ experience with events was based on creating Windows apps with MFC and the class wizard did all of the work for me, so I can't bash C++ here...but events are really useful in the work I do with C#.
  • Strings - this is huge. C++ has CString, LPCTSTR, LPTSTR, WCHAR*, TCHAR*, BSTR , _T - yuck!

Nowadays, my new motto is: "If I can't do it in C#, I'll use VC++." Heck, I'm even interested in learning how to write managed gaming applications, so I just ordered Beginning .NET Game Programming in C# by David Weller. I'll post a review when I'm finished with that book.  :-)


Digg!

posted on Friday, January 28, 2005 6:12 AM

Feedback

No comments posted yet.