473,386 Members | 1,710 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,386 software developers and data experts.

C++ Compared to C#

Ok, I guess this is a common question but I need reassurance here.

I've used VC++ MFC for many years and have a love hate relationship with it.

I've been playing with C# for a couple of weeks and think it could be the way forward.
1.. We don't want to use legacy code.
2.. We have no reason to use Unmanged code
3.. We need pretty fast execution speed but robustness and ease of code maintenance is preferable
4.. All our users can be moved up to Windows XP

So my question is... when starting from scratch would there be any reason to choose C++ over C#

Look forward to hearing any comments on this.

Many thanks

Phil Cunningham
Nov 16 '05 #1
8 1357
Not really Phil, I used C++ for years and I'm now almost exclusively
programming in C#.

I've deployed the .NET framework in several production applications and
generally found it to be very robust indeed. For code maintenance, I've
found C# is generally easier to manage than C++. Of course in terms of raw
speed C++ will sometimes have the edge over C# as you're no doubt aware, but
most of the time the differences are negligible (depending on your specific
application requirements). Also, some .NET 'innovations' such as the use of
the managed heap to allocate memory can speed up the code execution quite a
bit. The one area where you may find issues is that starting up programs
written using the .NET framework can take slightly longer than traditional
win32 API apps largely due to the fact that the code is JIT compiled on
startup. You can help to alleviate this to some extent by pre-jitting the
code, although for most apps this slight delay is not a problem - unless the
app will be started very often, run for short periods and then closed down,
the startup time is generally not an issue (and they normally only take a
second or two to start anyway...). Overall, I've found the execution speed
of managed .NET code to be very good.

Even if you do find that you need to use unmanaged code (either COM or
traditional dll functions) you'll find the .NET framework (and C#) has very
good support to enable you to do this, so you shouldn't have many issues
there.

There may be occasions when you find you don't have the same low level
control in your programs as you did with C++, although generally there are
ways around this by using API calls etc. This depends somewhat on the type
of programs you are writing - I've never found this to be a major issue not
sure about other peoples experiences here?

I've found that running .NET apps on XP or 2000 is preferable to running
them on NT 4 - the same apps ran somewhat slower when installed on NT 4
machines than on 2000 and XP machines although whether this was down to the
OS or the specific build I couldn't be certain.

One thing you didn't mention in your list is developer productivity - while
you will obviously have a learning curve to go through, after a few weeks /
months you 'should' find your productivity increasing quite significantly as
you find your way around the BCL and the winforms framework.

Anyway, good luck whatever you decide to do!
--
Steve Willcock, MCSD
http://www.willcockconsulting.com/

"phil cunningham" <ph**@oakleafsoftwareNOSPAM.co.uk> wrote in message
news:OE**************@TK2MSFTNGP09.phx.gbl...
Ok, I guess this is a common question but I need reassurance here.

I've used VC++ MFC for many years and have a love hate relationship with it.

I've been playing with C# for a couple of weeks and think it could be the
way forward.
We don't want to use legacy code.
We have no reason to use Unmanged code
We need pretty fast execution speed but robustness and ease of code
maintenance is preferable
All our users can be moved up to Windows XP

So my question is... when starting from scratch would there be any reason to
choose C++ over C#

Look forward to hearing any comments on this.

Many thanks

Phil Cunningham
Nov 16 '05 #2
Dear Steve

thanks very much for the reply

Back in 1989 C++ was a fantastic stepup from C, but many of the features
that I originally found so exciting about C++ do suffer from it being on top
of 'C' - it was a great tool but although you can do just about anything
with C++ many of them I'd rather not be able to do :)

I am extremely impressed by the way C# seems to know what to do without
header files - one C++ feature I wont miss.

So far my main reaction to C# is "surely it cant be so easy to do..." fill
in the blanks.

In fact the more I look at our exisiting product the more I see that at
least 50% of it is simply support code that we will no longer need, just
from that our program should be twice as stable.

Once again thanks for letting me know your experience, it is very reassuring
to hear

All the best
Phil
"Steve Willcock" <st***@N-O-S-P-A-Mwillcockconsulting.com> wrote in message
news:cf*******************@news.demon.co.uk...
Not really Phil, I used C++ for years and I'm now almost exclusively
programming in C#.

I've deployed the .NET framework in several production applications and
generally found it to be very robust indeed. For code maintenance, I've
found C# is generally easier to manage than C++. Of course in terms of raw
speed C++ will sometimes have the edge over C# as you're no doubt aware, but most of the time the differences are negligible (depending on your specific application requirements). Also, some .NET 'innovations' such as the use of the managed heap to allocate memory can speed up the code execution quite a bit. The one area where you may find issues is that starting up programs
written using the .NET framework can take slightly longer than traditional
win32 API apps largely due to the fact that the code is JIT compiled on
startup. You can help to alleviate this to some extent by pre-jitting the
code, although for most apps this slight delay is not a problem - unless the app will be started very often, run for short periods and then closed down, the startup time is generally not an issue (and they normally only take a
second or two to start anyway...). Overall, I've found the execution speed
of managed .NET code to be very good.

Even if you do find that you need to use unmanaged code (either COM or
traditional dll functions) you'll find the .NET framework (and C#) has very good support to enable you to do this, so you shouldn't have many issues
there.

There may be occasions when you find you don't have the same low level
control in your programs as you did with C++, although generally there are
ways around this by using API calls etc. This depends somewhat on the type
of programs you are writing - I've never found this to be a major issue not sure about other peoples experiences here?

I've found that running .NET apps on XP or 2000 is preferable to running
them on NT 4 - the same apps ran somewhat slower when installed on NT 4
machines than on 2000 and XP machines although whether this was down to the OS or the specific build I couldn't be certain.

One thing you didn't mention in your list is developer productivity - while you will obviously have a learning curve to go through, after a few weeks / months you 'should' find your productivity increasing quite significantly as you find your way around the BCL and the winforms framework.

Anyway, good luck whatever you decide to do!
--
Steve Willcock, MCSD
http://www.willcockconsulting.com/

"phil cunningham" <ph**@oakleafsoftwareNOSPAM.co.uk> wrote in message
news:OE**************@TK2MSFTNGP09.phx.gbl...
Ok, I guess this is a common question but I need reassurance here.

I've used VC++ MFC for many years and have a love hate relationship with it.
I've been playing with C# for a couple of weeks and think it could be the
way forward.
We don't want to use legacy code.
We have no reason to use Unmanged code
We need pretty fast execution speed but robustness and ease of code
maintenance is preferable
All our users can be moved up to Windows XP

So my question is... when starting from scratch would there be any reason to choose C++ over C#

Look forward to hearing any comments on this.

Many thanks

Phil Cunningham

Nov 16 '05 #3

"phil cunningham" <ph**@oakleafsoftwareNOSPAM.co.uk> wrote in message
news:ef*************@TK2MSFTNGP12.phx.gbl...
Dear Steve

thanks very much for the reply

Back in 1989 C++ was a fantastic stepup from C, but many of the features
that I originally found so exciting about C++ do suffer from it being on top of 'C' - it was a great tool but although you can do just about anything
with C++ many of them I'd rather not be able to do :)

I am extremely impressed by the way C# seems to know what to do without
header files - one C++ feature I wont miss.

So far my main reaction to C# is "surely it cant be so easy to do..." fill
in the blanks.

In fact the more I look at our exisiting product the more I see that at
least 50% of it is simply support code that we will no longer need, just
from that our program should be twice as stable.

Once again thanks for letting me know your experience, it is very reassuring to hear

All the best
Phil

Just wanted to add my second to Steve's eloquent reply. You sound like the
ideal candidate for C#.
Your comments on C++ ("... it was a great tool but although you can do just
about anything
with C++ many of them I'd rather not be able to do :)") speaks volumes!

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 16 '05 #4
Stroustrup himself called C++ a superset of C. In evolution new bits are added
on when the old cannot be revised to deal with new situations. As soon as you
do that (add bits on), you create interface problems. Also new bits were added
on to C++ again like STL. So C++ is a bit of a ragbag.

It is like an application that you keep on chopping and changing to meet new
demands. A day will arrive when you chuck the whole lot overboard an rewrite
the application. C# is a rewrite of what preceded.

(C# wasn't written with speed as a prime objective. Re C# language spec ECMA 334)

"phil cunningham" <ph**@oakleafsoftwareNOSPAM.co.uk> wrote in message news:OE**************@TK2MSFTNGP09.phx.gbl...
Ok, I guess this is a common question but I need reassurance here.

I've used VC++ MFC for many years and have a love hate relationship with it.

I've been playing with C# for a couple of weeks and think it could be the way forward.
1.. We don't want to use legacy code.
2.. We have no reason to use Unmanged code
3.. We need pretty fast execution speed but robustness and ease of code maintenance is preferable
4.. All our users can be moved up to Windows XP

So my question is... when starting from scratch would there be any reason to choose C++ over C#

Look forward to hearing any comments on this.

Many thanks

Phil Cunningham
Nov 16 '05 #5

-----
It is like an application that you keep on chopping and changing to meet new
demands. A day will arrive when you chuck the whole lot overboard an rewrite
the application. C# is a rewrite of what preceded.
--------

this is exactly where I am at.

Thanks for reply
Phil

"Adrian" <aa@aa.aa> wrote in message news:36***************************@freeler.nl...
Stroustrup himself called C++ a superset of C. In evolution new bits are added
on when the old cannot be revised to deal with new situations. As soon as you
do that (add bits on), you create interface problems. Also new bits were added
on to C++ again like STL. So C++ is a bit of a ragbag.

It is like an application that you keep on chopping and changing to meet new
demands. A day will arrive when you chuck the whole lot overboard an rewrite
the application. C# is a rewrite of what preceded.

(C# wasn't written with speed as a prime objective. Re C# language spec ECMA 334)

"phil cunningham" <ph**@oakleafsoftwareNOSPAM.co.uk> wrote in message news:OE**************@TK2MSFTNGP09.phx.gbl...
Ok, I guess this is a common question but I need reassurance here.

I've used VC++ MFC for many years and have a love hate relationship with it.

I've been playing with C# for a couple of weeks and think it could be the way forward.
1.. We don't want to use legacy code.
2.. We have no reason to use Unmanged code
3.. We need pretty fast execution speed but robustness and ease of code maintenance is preferable
4.. All our users can be moved up to Windows XP

So my question is... when starting from scratch would there be any reason to choose C++ over C#

Look forward to hearing any comments on this.

Many thanks

Phil Cunningham
Nov 16 '05 #6
WHY
Adrian wrote:
(C# wasn't written with speed as a prime objective. Re C# language spec
ECMA 334)


I think c# is the final admission of c programmers that what IT and most
programming projects really need is Visual Basic 6.0 in a form that can do
threads and can run reasonably fast.

Because they still cannot give up their precious idea that 'c' is so
superior, they took what is basically Visual Basic with an improved memory
model and mega-COM objects ( now called assemblies ) and made it look like
c.

Then of course they stole all every idea java ever had and threw that in.

That's ok. Java was just a rip off of visual basic.

If Visual Basic could write applications that didn't look like crap when
they repainted the screen -- it would have dominated all programming in the
last 10 years.

Instead, here's the hapless m$ trying to catch up to java.

Well, at least one good thing came out of it: mono.

www.go-mono.com

--
http://kentpsychedelic.blogspot.com/
Updated 8/8/04
Nov 16 '05 #7
Everyone is free to use the language of their choice.
Choice is a good thing, because variation happens
to guarantee that the most fittest will survive. No
variation (say nothing but VB) would therefore
be a bad thing. M$ is a bit of a blessing really
because you need lots of money to plough back
into improved quality. As to pinching good ideas,
would you prefer to scrap all good ideas, rather
than build on them? Most developments are what
Schumpeter called "neue Kombinationen" that is,
recombinations of what was already there and
available.

"WHY" <do****@of.sour.cream> wrote in message
news:31****************@news.west.earthlink.net...
Adrian wrote:
(C# wasn't written with speed as a prime objective. Re C# language spec
ECMA 334)
I think c# is the final admission of c programmers that what IT and most
programming projects really need is Visual Basic 6.0 in a form that can do
threads and can run reasonably fast.

Because they still cannot give up their precious idea that 'c' is so
superior, they took what is basically Visual Basic with an improved memory
model and mega-COM objects ( now called assemblies ) and made it look like
c.

Then of course they stole all every idea java ever had and threw that in.

That's ok. Java was just a rip off of visual basic.

If Visual Basic could write applications that didn't look like crap when
they repainted the screen -- it would have dominated all programming in

the last 10 years.

Instead, here's the hapless m$ trying to catch up to java.

Well, at least one good thing came out of it: mono.

www.go-mono.com

--
http://kentpsychedelic.blogspot.com/
Updated 8/8/04

Nov 16 '05 #8

Maybe I'm a bit of a sucker but I really like Microsoft Products. The amount
of tools now available is really incredible compared to a few years back and
it I dont see how something like .Net could be done except by a company with
enough muscle and money to impose a standard and supply an enormose
potential user base. As long as the tools get better, allow me to do what I
need to do and help me be more productive I'm a happy chap.

Mind you, I'm programming exclusive for Windows so I dont really care about
portability issues.

I suppose if you are a VB programmer you may object to the curly brackets
and ; but for everyone coming from C,C++ it makes it very easy to get going.

maybe some people take all this progress for granted but as a C++ programmer
I can only sit and wonder at how good C# is

Phil
"Adrian" <aa@aa.aa> wrote in message
news:a5**************************@freeler.nl...
Everyone is free to use the language of their choice.
Choice is a good thing, because variation happens
to guarantee that the most fittest will survive. No
variation (say nothing but VB) would therefore
be a bad thing. M$ is a bit of a blessing really
because you need lots of money to plough back
into improved quality. As to pinching good ideas,
would you prefer to scrap all good ideas, rather
than build on them? Most developments are what
Schumpeter called "neue Kombinationen" that is,
recombinations of what was already there and
available.

"WHY" <do****@of.sour.cream> wrote in message
news:31****************@news.west.earthlink.net...
Adrian wrote:
(C# wasn't written with speed as a prime objective. Re C# language spec ECMA 334)


I think c# is the final admission of c programmers that what IT and most
programming projects really need is Visual Basic 6.0 in a form that can do threads and can run reasonably fast.

Because they still cannot give up their precious idea that 'c' is so
superior, they took what is basically Visual Basic with an improved memory model and mega-COM objects ( now called assemblies ) and made it look like c.

Then of course they stole all every idea java ever had and threw that in.
That's ok. Java was just a rip off of visual basic.

If Visual Basic could write applications that didn't look like crap when
they repainted the screen -- it would have dominated all programming in

the
last 10 years.

Instead, here's the hapless m$ trying to catch up to java.

Well, at least one good thing came out of it: mono.

www.go-mono.com

--
http://kentpsychedelic.blogspot.com/
Updated 8/8/04


Nov 16 '05 #9

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

Similar topics

3
by: Sig | last post by:
Hi there, Could you help me finding out whether Zope could be a serious technological framework for big corporation (compared to J2EE and ..Net) or not ? In the (quite very) big corporation I...
30
by: Christian Seberino | last post by:
How does Ruby compare to Python?? How good is DESIGN of Ruby compared to Python? Python's design is godly. I'm wondering if Ruby's is godly too. I've heard it has solid OOP design but then...
1
by: Marc H. | last post by:
Hello, I recently converted one of my perl scripts to python. What the script does is simply search a lot of big mail files (~40MB) to retrieve specific emails. I simply converted the script...
1
by: Mat Hess | last post by:
We are currently developing a new application. In this application, we have a table which will hold a large number of rows, where many text fields (one text field per row) will be stored. The users...
3
by: nandan | last post by:
Hi, Has any one ever compared the performance of calling a DataTable's Select method with a stored procedure doing the same thing? My point is: dataRows = DataTable.Select(filter) is better or...
2
by: Steve | last post by:
Hi there I have just discovered this group, so bare with me if this post is not relevant. I am undertaking a project to compare XML data transmission over a network compared to that of Binary...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
11
by: 73blazer | last post by:
We are migrating a customer from Version 7.1 FP3, to Version 8.2 (8.1 FP8). For the most part, things are faster, but there is one query that is much much slower, and it is a query that is used all...
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
25
by: Andy B | last post by:
How hard/easy is it to use/learn VB compared to c#?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.