Why C#

  • Thread starter Thread starter Bruce F
  • Start date Start date
Ben,

What you write is in my opinion also for C# (and VB.Net or whatever Net
language).

A complete modulair program is very simple to make to set everything static
or to create structs.
That the name for a static class is "class" does not mean that it is an
object, it is simple a part of the program on the stack.

(Don't misunderstand me, I don't want it in another way).

Cor
 
"Bruce F"
Why should I use C# programming rather than C++?
Does C# have advantages over C++?

No, does anybody tell you you should, it is like using a Humber, why would
you stop using it, does a Hybrid drive better. I don't think so.

Cor
 
Göran Andersson said:
Yes, but it's not "pure" object oriented in the same manner as C# where
every data type is object oriented and code only exists inside classes.

The practical importance of that is small. The difference between
a namespace and a static class is very small.
But not strictly typed...

Compile time they are about the same.

C# has stricter runtime checks than C++ (assuming we speak about
unmanged).

But there are languages that are much more strict than C#.

Arne
 
Mike said:
True, but here I think C# hits the sweet spot.

In C, it's almost impossible to avoid potentially unsafe constructs
like pointers.

In Java, you can't use a raw pointer even when you'd really like to.

In C#, you have the option, but you're explicitly aware that you're
doing something dangerous and can make the tradeoff between safety and
performance i an informed fashion.

I would tend to agree.

It is clearly identified all the way that there are
something potential dangerous.

I even like the keyword !

Arne
 
Ben said:
If you need to run on more than just Windows or more than just PCs, C++.

Not necessarily.

Java and some of the dynamically typed languages seems a lot more
portable than C++.
If
you need to talk to hardware, C++.
Yep.

If you need to crunch bits, C++
Yep.

If you want to do frilly WPF or web stuff or database queries, C#. The
language is simpler which makes it much easier to design tools to work with
it, so there are many more wizards for C#.

It is not primarily a tool issue.

It is simply easier to write the code in C#.

And you don't need direct hardware access or bit manipulation.

Arne
 
Zach said:
oooooooooooooooooooooooooooooooooooooo
You will be up to speed much quicker with C#.
Put a query on a C++ use group asking whether
C++ is just C plus OO added on, and watch them
all get hysterical, because that is just what it is. It
is like driving a rally in a T-Ford.

I think that comparison is correct.

C++ is a formula 1 race car.

C# is a SUV.

If you need to participate in a race then the formula 1 car
is great.

But most people just need something to drive down to the
supermarket and pick up groceries. And the the SUV is
better.

Arne
 
Michael said:
Yes, and neither is Java or C#. Any language which allows anything
like bad_cast or InvalidCastException at run-time is not strictly
typed.

Or go up to Ada.

Arne
 
Ben said:
I guess I was using "need" in a stronger sense of "it HAS to work", which
implies some level of commercial support for the toolchain. That doesn't
have to mean proprietary, but it does rule out half-finished technology
demonstrations like mono.

Bullshit.

There are a few companies that actually uses Mono.

It is not a "half-finished technology demonstration".
But C++ templates beat the .NET JIT optimizer hands down in this area. C#
hasn't even got a complex number type, and it's impossible to have a fast
complex generic.

C# is not a strong contender in scientific computing.

Fortran is number one. And C/C++ may be number 2. And C# must be
down in the double digits numbers somewhere.

Arne
 
Ben said:
C++ adds a lot more to C than just object oriented syntactic sugar. And
don't even try to say that C# generics are the same as C++ templates.

C++ code utilizing all the newer features in C++ is very different
from C.

But C++ anno 1990 was not that far from what Zach described.

Arne
 
C# code is strictly-typed, object-oriented and has a well-defined
grammar unlike C++.

C++ is object oriented, strictly typed and has well-defined grammar.
Well-written C# code is easy to understand and serves as the living-
documentation of the system.


You should write comments in C# code just as for any other
language.

Arne
 
Arne Vajhøj said:
C++ code utilizing all the newer features in C++ is very different
from C.

But C++ anno 1990 was not that far from what Zach described.

And C# anno 1990 was?

To argue for C# today based on weaknesses C++'s predecessor C-with-classes
had 20 years ago is either misinformed or outright dishonest. Let me tell
you about the pain caused by C# (1) lack of typesafe collections.
 
Back
Top