473,499 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

My C++ vs. C# Conclusion

After questioning, reading, and posting back and forth, I have finally
determined that as far as desktop .NET development is concerned, C# is simply
a subset of C++, period. There is nothing you can do in C# that you can't do
in C++ but there are things you can do with C++ that you can't do with C#.

C# may be easier and may be a bit more RAD but that's not what interests me.
Perfomance and flexibility are what interest me and that's where C++ has the
edge.

Hope this is helpful to all those who seem so unsure (as I was) which
language to chose.

If peak performance and the most language features is important to you, then
C++.

If decent performance easier/RAD development is more important to you then C#.

My general recommendation is C++.

--
Greg McPherran
www.McPherran.com
Feb 16 '06 #1
5 2867

"Greg" <gm@mcpherran.com> wrote in message
news:26**********************************@microsof t.com...
After questioning, reading, and posting back and forth, I have finally
determined that as far as desktop .NET development is concerned, C# is
simply
a subset of C++, period. There is nothing you can do in C# that you can't
do
in C++ but there are things you can do with C++ that you can't do with C#.

C# may be easier and may be a bit more RAD but that's not what interests
me.
Perfomance and flexibility are what interest me and that's where C++ has
the
edge.

Hope this is helpful to all those who seem so unsure (as I was) which
language to chose.

If peak performance and the most language features is important to you,
then
C++.

If decent performance easier/RAD development is more important to you then
C#.

My general recommendation is C++.


I use both. Where appropriate :)

Now some gurus, might immediately comment now that I am not specific enough
:)

Feb 16 '06 #2
You hit the nail on the head.

One thing about C# though - it adds a fair bit of syntactic sugar - for
example:
1. "using": this isn't much harder in C++, but you do have to think about
what it is that "using" does.
2. Properties in C# don't force you to type the property type in three
places like C++/CLI does - that's really annoying!
3. C# has some shortcuts for declaring delegates and events.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter

"Greg" wrote:
After questioning, reading, and posting back and forth, I have finally
determined that as far as desktop .NET development is concerned, C# is simply
a subset of C++, period. There is nothing you can do in C# that you can't do
in C++ but there are things you can do with C++ that you can't do with C#.

C# may be easier and may be a bit more RAD but that's not what interests me.
Perfomance and flexibility are what interest me and that's where C++ has the
edge.

Hope this is helpful to all those who seem so unsure (as I was) which
language to chose.

If peak performance and the most language features is important to you, then
C++.

If decent performance easier/RAD development is more important to you then C#.

My general recommendation is C++.

--
Greg McPherran
www.McPherran.com

Feb 16 '06 #3
David Anton wrote:
You hit the nail on the head.

One thing about C# though - it adds a fair bit of syntactic sugar -
for example:
1. "using": this isn't much harder in C++, but you do have to think
about what it is that "using" does.
#using - an assembly reference from within the source code -no need to
define it at the project level.
using namespace - same as C#'s using.
2. Properties in C# don't force you to type the property type in three
places like C++/CLI does - that's really annoying!
True, but C++/CLI supports "trivial properties" while C# doesn't:

property int Foo;

automatically creates a getter, a setter and a private field to back up the
property.
3. C# has some shortcuts for declaring delegates and events.


C# 2.0 also has the new iterator and anonymous method support, both of which
can save a lot of typing.

C++/CLI syntax for declaring a "trivial event" is virtually identical to C#:

event EventHandler^ Event;

while C++/CLI's non-trivial event takes a tiny bit more typing than the C#
equivalent.

-cd
Feb 16 '06 #4
About "using": I was referring to the other use of the "using" keyword in C#:
e.g.,
using (foo)
{
}

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter

"Carl Daniel [VC++ MVP]" wrote:
David Anton wrote:
You hit the nail on the head.

One thing about C# though - it adds a fair bit of syntactic sugar -
for example:
1. "using": this isn't much harder in C++, but you do have to think
about what it is that "using" does.


#using - an assembly reference from within the source code -no need to
define it at the project level.
using namespace - same as C#'s using.
2. Properties in C# don't force you to type the property type in three
places like C++/CLI does - that's really annoying!


True, but C++/CLI supports "trivial properties" while C# doesn't:

property int Foo;

automatically creates a getter, a setter and a private field to back up the
property.
3. C# has some shortcuts for declaring delegates and events.


C# 2.0 also has the new iterator and anonymous method support, both of which
can save a lot of typing.

C++/CLI syntax for declaring a "trivial event" is virtually identical to C#:

event EventHandler^ Event;

while C++/CLI's non-trivial event takes a tiny bit more typing than the C#
equivalent.

-cd

Feb 16 '06 #5

Are you talking about native C++ or managed C++?

Native C++ doesn't have modern features such as garbage collection or
delegates. Managed C++ will give you what C# does, but it's more
complicated to use.

If you care about pure flexibility and performance, then assembly language
can do everything that C++ can do. But normally we're not _purely_
interested in those things. It's a tradeof between those things and ease of
development and expressiveness. So I think it's apples and oranges. I would
like to use C# for some of the things I have to do, but I simply cannot
because I need to use a systems level language.

BTW, if you want modern language features AND the performance of a systems
level language, you might want to look into the D language. It's very nice,
although not mainstream.

"Greg" <gm@mcpherran.com> wrote in message
news:26**********************************@microsof t.com...
After questioning, reading, and posting back and forth, I have finally
determined that as far as desktop .NET development is concerned, C# is
simply
a subset of C++, period. There is nothing you can do in C# that you can't
do
in C++ but there are things you can do with C++ that you can't do with C#.

C# may be easier and may be a bit more RAD but that's not what interests
me.
Perfomance and flexibility are what interest me and that's where C++ has
the
edge.

Hope this is helpful to all those who seem so unsure (as I was) which
language to chose.

If peak performance and the most language features is important to you,
then
C++.

If decent performance easier/RAD development is more important to you then
C#.

My general recommendation is C++.

--
Greg McPherran
www.McPherran.com

Feb 16 '06 #6

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

Similar topics

50
5429
by: Edward K. Ream | last post by:
I would like to say a few (actually more than a few) words here about some recent discoveries I have made concerning the interaction of Leo and Python. If you don't want to hear an inventor enthuse...
8
4506
by: adrien | last post by:
Thanks for all the answers about how to hide scrollbars in netscape. The conclusion is that it's not possible. My initial purpose is to compare some Netscape and IE possibilities and it's the...
0
971
by: Rajko | last post by:
Well, I don't know if this is 100% true and all comments are welcome. I built statically linked MFC DLL as shell extension. One function generated stack overflow all the time. DEBUGGING...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.