473,322 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Managed C++.NET vs VB.NET vs C#.NET

I'm at a point where I would really like to focus in on learning .NET but am
having a hard time deciding which language to use. I learned to program in
C++ but have spent quite a bit of time using VB6. I need to get started on
developing a new application and would like to know what the advantages are
of using managed C++ .NET over VB.NET or C#? My application will involve
some, data acquisition, storage, data plotting, statistical analysis over
multiple sets of test data ( 20,000 - 30,000 double values per set), and
report generation.

Any thoughts on the subject would be greatly appreciated.

Dave
Nov 17 '05 #1
3 6165
"Dave" <vb_re_move_@4scotts_re_move_.com> wrote in message
news:uY*************@TK2MSFTNGP09.phx.gbl...
I'm at a point where I would really like to focus in on learning .NET but am having a hard time deciding which language to use. I learned to program in C++ but have spent quite a bit of time using VB6. I need to get started on developing a new application and would like to know what the advantages are of using managed C++ .NET over VB.NET or C#? My application will involve
some, data acquisition, storage, data plotting, statistical analysis over
multiple sets of test data ( 20,000 - 30,000 double values per set), and
report generation.


<Warning this reply drips with personal opinion/>

If VB confers any advantages then I don't know what they are. :-)

Managed C++ is the only .Net language of MS' that allows a developer to mix
almost seamlessly managed and unmanaged code in the same application or even
the same module. It also brings with it much (but not all) of C++'s
complexity and a few little twists of its own.

C# is a new language, developed especially to target .Net. It is less
powerful and less general purpose than C++ but it is a nice, simple and
elegant language.

In short, I'd eliminate VB out of hand. If you need to target .Net as well
as Win32 or if you think that your .Net application will make substantial
use of the Win32 API I'd use MC++. If you target .Net exclusively, I'd use
C#.

Regards,
Will

Nov 17 '05 #2
I would only use managed C++ for your project if you need to access existing
C++ libraries that do not expose COM interfaces, or if you make extensive
use of large portions of the Win32 api or other C libraries.

C# and VB.Net allow you to access COM objects through interop assemblies
(generated automatically from type libraries by Visual Studio .NET), so
including com libarires in your project is relatively easy,

However, "regular" C++ classes cannot be reliably used across language or
compiler boundaries (which is the whole reason COM was created), and
template classes do not exist at run time so you would not be able to
utilize non COM based C++ libraries from C# or from Visual Basic without
wrapping them up with a .NET Assembly written in Managed C++.

C functions, such as those in the Win32 API can be used in C# or VB.Net via
the "extern" or "declare" constructs repsectively (the C# "extern" construct
is not identical to the C++ "extern" construct, so you should read the
documentation on it if you decide to go with C#). However if you use a lot
of C functions, particularly if the take pointers to large structures as
arguments, the use of extern / declare can get to be rather tedious and you
would be better off using Managed C++.

However, Managed C++ has some restrictions on it that as a C++ program you
may find frustrating, you will more than likely have several linker realted
headaches, you will consistently have to wory about the garbage collector,
and you may have to use pointers in places your C++ design skills tell you
shouldn't require pointers.

The value semantics between the .NET CLR and C++ are different, and that
introduces several incompatibilities that will cause you to use pointers to
C++ classes rather than stack based instances as attributes of managed
types. Also, if your managed types contain pointers to unmanged data that is
owned by other managed types, you have to make sure to place a reference to
the owning managed type in the referenced managed type to be sure that the
garbage collector sees the relationship between the two managed types,
otherwise you will have dangling references lying around.

Basically, Managed C++ can be irritating, so only use it when you need to.

For the most part C# and Visual Basic.NET are identical. C# offers an
"unsafe context" where you can have pointer types and do pointer artihmetic
and other unsafe things that VB.NET doesn't support, and VB doesn't allow
you to do operator overloading. However unsafe C# is rarely ever required,
and you can get around operator overloading by creating methods.
So the primary factor in choosing between C# and VB.Net is style preference.

Because youre first language was C++, you will probably like C# better than
VB.Net.
Basically, the purpose of C# was to give C++ programers the RAD development
capabilities of Visual Basic 6, while keeping a C++ look and feel. The
equation I use to describe C#, is "VB = VB + 1" which plays on the meaning
of C++, noting that Visual Basic doesn't have a ++ operator.

"Dave" <vb_re_move_@4scotts_re_move_.com> wrote in message
news:uY*************@TK2MSFTNGP09.phx.gbl...
I'm at a point where I would really like to focus in on learning .NET but am having a hard time deciding which language to use. I learned to program in C++ but have spent quite a bit of time using VB6. I need to get started on developing a new application and would like to know what the advantages are of using managed C++ .NET over VB.NET or C#? My application will involve
some, data acquisition, storage, data plotting, statistical analysis over
multiple sets of test data ( 20,000 - 30,000 double values per set), and
report generation.

Any thoughts on the subject would be greatly appreciated.

Dave

Nov 17 '05 #3
> If VB confers any advantages then I don't know what they are. :-)
...
In short, I'd eliminate VB out of hand.

Regards,
Will


Of course, by posting to this NG you're going to get someone against VB and
in favor of primarily MC++... try posting to
microsoft.public.dotnet.languages.csharp and you'll get people against MC++
and VB.NET. Post to microsoft.public.dotnet.languages.vb and you'll get
people with all the reasons why you should do it in VB and not C# or MC++.
It's all subject. One can only hope to know how to discern through the
pointless bias and instead see the real points to subjectively compare the
various features of the languages available against the needs of the project
and skillset.

In short, C# is probly your best bet. Depends on how much performance you
need and low-level interfacing will be required, MC++ may be another bet.
Even better yet, do you low-level, direct-hardware interfacing in mixed
MC++/unmanaged C++ and put it in an assembly, and do the rest in C# just
referencing it...
Thanks,
Shawn
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
1
by: lolomgwtf | last post by:
I have a managed C++ method that wraps unmanaged code and creates a managed object holding data retrieved form an unmanged one. I want create an instance of this managed class in C#, pass it to...
16
by: Ekim | last post by:
hello, I'm allocating a byte-Array in C# with byte byteArray = new byte; Now I want to pass this byte-Array to a managed C++-function by reference, so that I'm able to change the content of the...
2
by: lolomgwtf | last post by:
I have a managed C++ method that wraps unmanaged code and creates a managed object holding data retrieved form an unmanged one. I want create an instance of this managed class in C#, pass it to...
2
by: asanford | last post by:
We use StackWalk(StackWalk64) from dbghelp.dll to walk our callstacksas needed, using the various Sym* methods (SymGetSymFromAddr, SymGetLineFromAddr) to resolve source file, function name, and...
4
by: William F. Kinsley | last post by:
My understanding is that when I re-compile a existing MFC application with the /clr switch, that the code generated is managed(with some exceptions) but that the data isn't, i.e. not garbage...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
12
by: DaTurk | last post by:
Hi, I have a rather interesting problem. I have a unmanged c++ class which needs to communicate information to managed c++ via callbacks, with a layer of c# on top of the managed c++ ultimatley...
3
by: Klaus | last post by:
Hi, I have an existing VC 6 MFC application which communicates asynchronly with a VC 2005 managed code dll. I use an unmanaged base class with virtual functions to access methods in the MFC...
8
by: Varangian | last post by:
Hello, was wondering of how to dispose of managed resources? or referencing every member of a class to null will release resources...? http://www.marcclifton.com/tabid/79/Default.aspx...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.