473,749 Members | 2,402 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 2874

"Greg" <gm@mcpherran.c om> wrote in message
news:26******** *************** ***********@mic rosoft.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.c om> wrote in message
news:26******** *************** ***********@mic rosoft.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
5506
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 about his work, please feel free not to read further :-) There are at least three, no four, no five, no six, no seven reasons why Leo and Python work so well together. Most are new (in my mind) with the 4.1 release of Leo. The first several...
8
4523
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 second time that i have to conclude that Netscape can't do something while IE does: 1) IE is able to hide scrollbars (even only vertical or only horizontal) while Netscape is not. 2) IE is able to start a sound (wav) when the mouse e.g. goes over an...
0
985
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 function was looking like this: void My_Func(_TCHAR *str1, _TCHAR *str2, _TCHAR arr) { My_Func(str1, str2, arr); {
0
8833
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4709
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3320
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 we have to send another system
3
2218
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.