C# -- Good or Bad?

J

Jewbster

I was wondering if anyone had any thoughts on the relatively new C#
programming. Do you think it is getting too far away from the barebones
of coding, or do you think it is a practical, or possitive, step
forward?
 
M

Matthias =?ISO-8859-1?Q?K=E4ppler?=

This has nothing to do with ISO C++, but... :)

I have only worked with C# for an assignment during an internship, and I
liked it a lot better than Java. It's cleaner and more consequent than
Java. IMO properties and delegates for example are language constructs
which really make sense to have in an OO language. D has them, too.
 
J

Jewbster

Sorry, first time using the google groups.

Do you think this is something witch could replace C/C++, or is not
quite powerful enough?
 
M

Mark Bruno

I'm kinda sick of people going nuts with being off topic. C# from the C++
programmer's perspective is an interesting topic and might as well be
discussed here. This is comp.lang.c++, not comp.std.c++, so we should allow
a little lee way. Anyway, as for my opinon. I think that a "higher level"
language is necessary in today's computing environment, but have always been
annoyed with some of java's fickleness. C# takes what java's laid the
ground for, but adds some stuff I missed from C++, such as pointer
manipulation. So I like it, but would never undertake a serious programming
endeavor in it, unless I was heavily relying on the .net framework.
 
M

Matthias =?ISO-8859-1?Q?K=E4ppler?=

Jewbster said:
Sorry, first time using the google groups.

Do you think this is something witch could replace C/C++, or is not
quite powerful enough?

No, I don't think it will ever "replace" C++ for several reasons.

First, it's a proprietary language, designed for a proprietary platform
(that is, Microsoft's .NET). That's generally a bad thing, because you're
dependant on one single instance which has total control. That's also one
of the points I don't like Java.

Second, C#, like Java, is working on an abstract machine, namely the .NET
runtime. It is half interpreted, half compiled to some sort of intermediate
language (MSIL). So you have the overhead of an additional abstraction from
the hardware and system software and the additional overhead of translating
the mnemonics of the abstract machine to commands your system understands
at *runtime*. In other words, it's (generally) slower than a binary program
produced by your highly optimized C++ compiler.

Third, regardless how more abstract and intuitive programming languages will
become, there are always situations where you need languages which allow to
work close to the hardware, like C and C++. There are situations, where you
HAVE to deal with your memory directly and don't want the garbage collector
to do the work for you.

Bottom line being, C# has its niche, so do C and C++. I doubt this will
change anytime soon.

Just my 2 cents.

Regards,
Matthias
 
C

Chris Gordon-Smith

Mark said:
I'm kinda sick of people going nuts with being off topic.

Me too. So long as a topic has some general relationship to C++, its likely
to be of interest to me. Constantly insisting on discussion of only the C++
standard seems to me to be a very narrow point of view.
 
C

Chris Gordon-Smith

Matthias Käppler wrote:

First, it's a proprietary language, designed for a proprietary platform
(that is, Microsoft's .NET).

I'm not sure that's strictly true. Here's what the Mono website says:-

QUOTE
Microsoft has submitted the specifications of C#, the runtime, the metadata
and the other various bits of the .NET development platform to the ECMA for
standarization.
UNQUOTE
 
M

Matthias =?ISO-8859-1?Q?K=E4ppler?=

Chris said:
QUOTE
Microsoft has submitted the specifications of C#, the runtime, the
metadata and the other various bits of the .NET development platform to
the ECMA for standarization.
UNQUOTE

That's good news!
 
E

EventHelix.com

I agree with you.

Has there been some discussion in the C++ community about incorporating
some of the features from C# ?

I would like to see C++ support:
- Event handling
- Attributes
- in/out indication is parameters
- Option for garbage collection

Deepa
 
J

Jewbster

Is there any good editor you can use, that has the ease of use and
capabilities of 'Visual C#' that is either cheap or free.

*or maybe somewhere 'Visual C#' can be found for free; I've looked
fairly thoroughly
 
F

fuzzylollipop

Python is a MUCH better choice that C# ( or Java ) for that matter. It
has the high-level goodness with the ability to EASILY integrate C/C++
code for performance critical sections! The best of both worlds!
 
J

jcoffin

[ talking about C# ... ]
First, it's a proprietary language, designed for a proprietary
platform (that is, Microsoft's .NET). That's generally a bad
thing, because you're dependant on one single instance which
has total control. That's also one of the points I don't like
Java.

Actually, C# and the CLI are arguably even more standardized than C++.
Like C++, each has an ISO standard, but unlike C++ each also has an
ECMA standard (that is essentially identical to the ISO standard). From
a practical viewpoint, simply having the same standard endorsed by more
standards bodies means little. OTOH, ECMA standards are all available
for free download, which is kind of nice.

Java is a whole different kettle of fish: AFAIK, it's never been
endorsed by even a single standards organization, and it looks like Sun
has given up on even trying to create the illusion of it being
independently defined.
Second, C#, like Java, is working on an abstract machine, namely
the .NET runtime. It is half interpreted, half compiled to some
sort of intermediate language (MSIL). So you have the overhead
of an additional abstraction from the hardware and system
software and the additional overhead of translating the mnemonics
of the abstract machine to commands your system understands
at *runtime*. In other words, it's (generally) slower than a
binary program produced by your highly optimized C++ compiler.

This is an accurate description of the first generation of Java Virtual
Machines, but not really of most current ones, nor of (at least MS's
implementation of) the CLI. These implementations use JIT compilation,
so anything that runs often enough to care much about will get compiled
to native code rather than being interpreted. This doesn't guarantee
the same speed as C++ (any more than code from all C++ compilers is
identical in speed) but using a virtual machine, by itself, doesn't
necessarily imply a loss of speed either. OTOH, even with JIT
compilation, you see the time taken to compile the code as part of the
run-time, which can limit the utility of heavy-duty optimization except
where code is really executed a lot. At the same time, JIT compilation
more or less implies the availability of run-time directed
optimization, which many C and C++ compilers lack. From what I've seen,
the speed handicap of Java stems primarily from other points. I've done
only minimal work with C#, but at least at first glance, its speed
appears to be reasonably competitive as well.
Third, regardless how more abstract and intuitive programming
languages will become, there are always situations where you
need languages which allow to work close to the hardware, like
C and C++. There are situations, where you HAVE to deal with
your memory directly and don't want the garbage collector to
do the work for you.

It's true that access to the hardware is sometimes needed. If you're
really planning on writing an OS (or even a device driver), C# is
probably a poor choice. OTOH, the majority of C and C++ I've seen
really has little need for direct access to the hardware. For even more
direct access to the hardware, you might want to learn Verilog (or
VHDL).

Finally, I'd note that in some cases, interpretation can actually
improve speed. A byte-code interpreter is usually a small, tight loop
with extremely high locality of reference. Byte codes are typically
much more compact than binary code. These two factors tend to lead to
excellent cache usage. A modern CPU can execute quite a few
instructions in the time taken for one main memory access, so
interpretation doesn't necessarily imply a speed loss.
 
E

EventHelix.com

You should be able to download Visual C# 2005 Express Beta from
Microsoft's website.

Deepa
 
J

Jewbster

I d/led Visual C# 2005 Express Beta, but when I went to install it, the
installer took the longest time to d/l the components needed that it
was unreal.

I'm not sure if I got a bad d/l(even tho i got it from a microsoft
affiliate, msdn, or if it's just because it's a beta version.

It would've taken a month to d/l these components, so if you have any
thoughts please post them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,186
Messages
2,570,998
Members
47,587
Latest member
JohnetteTa

Latest Threads

Top