My C++ vs. C# Conclusion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 said:
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
:)
 
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
 
David said:
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
 
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
 
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.
 
Back
Top