tags:

views:

128

answers:

4
+1  Q: 

C++ and C# for OOP

As far as programming with the object-orientated paradigm go, which is the better, easier-to-use language, C++ or C#? What are the distinct differences. Oh, and is C# a strict-superset of C or not.

As a side note, are there any other worthwhile paradigms worth looking at other the OO? (That can be used with C++/C#).

+3  A: 

... easier-to-use language, C++ or C#?

Definitely C#.

Oh, and is C# a strict-superset of C or not.

No way.

As a side note, are there any other worthwhile paradigms worth looking at other the OO? (That can be used with C++/C#).

Functional Programming (C#, C++0x)

Prasoon Saurav
C++0x surely helps, but you can do many interesting thins in C++03, too!
Francesco
A: 

Templates allow for a functional programming approach to C++. You can do computations at compile-time instead that at run time. There is a lot of material on this topic, perhaps the two most clear examples are to be found in these two books:

  1. C++ Template Metaprogramming
  2. Modern C++ Design
Francesco
+2  A: 

Better?

Depends. Do you want low level control over how your program behaves? Then C++ is probably the better choice. If not, then I would say C#

Easier-to-use

Definitely C#

Is C# a strict superset of C?

Not by far. They share a few syntactical similarities, but that's about it.

Any other paradigms worth looking at other than OO?

Functional programming. With 3.5 and 4.0, C# definitely includes some features that blur the line between OO and Functional Programming (but still allow the two to play nicely together in your applications). C++0x will bring some of those features to C++ as well.

Justin Niessner
+3  A: 

which is the better,

For what purpose?

easier-to-use

Depends on your experience. C# is hard for me because I'm fluent enough in C++ so C# limitations make me angry.

distinct differences

There are many comparisons on the net. The first thing that always comes first to my mind is RAII.

Oh, and is C# a strict-superset of C or not.

Definitely not. int main(){} is the shortest program in C. It's not valid C#.

As a side note, are there any other worthwhile paradigms worth looking at other the OO?

Yes, RAII, generic programming.

ybungalobill