C# Cons?

Started by
32 comments, last by patindahat 20 years, 8 months ago
Unfortunately this is pretty much on par for HenryApe in his subtle campaign for java evangelism.
Here are some tell-tale signs:

1. Make unsubstantiated comments
"Btw, when looking for info on security implications of virtual and final I found a solution to Arild''s versioning problem where the compiler automaticly generates the override switch. It now seems to me as if virtual, sealed, and override could all be replaced with just final. "
2. Use slightly incorrect terminology for java''s competitors("dotNet"? Who spells it like that?)
3. Make factually incorrect comments
"and uses a compilation model where the compiler can determine exactely what classes are overloaded at the time of compilation. "
"That C# does not include dynamic classloading implies that Heilsberg might have had other reasons for keeping virtual though. To support static compilation models. "
Advertisement
quote:Make unsubstantiated comments

Are you saying that a compiler can't tell whether a method overrides a method in the superclass? If it can, what's unsubstantiated about having it generate the override switch.

quote:Use slightly incorrect terminology for java's competitors("dotNet"? Who spells it like that?)

Magazines over here spell it like that because periods break up their sentence structure. I agree with them.

Here is another magazine that does it and Google is full of other examples, it's just not that uncommon.

quote:Make factually incorrect comments
"and uses a compilation model where the compiler can determine exactely what classes are overloaded at the time of compilation. "

What's factually incorrect about runtime compilers knowing about exactely what classes and methods are overloaded? That's why they can perform optimizations such as aggressive inlining and automatic devirtualization (making virtual calls static when the method is not overloaded).

quote:"That C# does not include dynamic classloading implies that Heilsberg might have had other reasons for keeping virtual though. To support static compilation models. "

Yes, both Java and C# can be staticly compiled you know. It's easier to do it with C# though because of keywords such as virtual.

Did your registered handle get banned for crap posting? Troll...



[edited by - HenryAPe on August 18, 2003 4:11:03 AM]
Bruce Eckel had some interesting things to say about C# in an interview at the Borland website:


I was incredibly skeptical about C# at first, for quite awhile. However, as time passed and I began to learn about the language, I started to see that it really is a better Java. They didn''t discard everything possible from C++, for example. Like operator overloading -- In Java, they basically say operator overloading is evil and you shouldn''t be able to do it, but then they include operator + and += in the String class, so obviously someone didn''t think it was so bad. Yes, you shouldn''t use it everywhere, but occasionally it comes in real handy. And C++ operator overloading is incredibly complex to get right -- I spend a whole chapter on it in "Thinking in C++" -- but a lot of that comes from the memory-management issues. In C# (and in Java, if they would have thought about it) operator overloading is much simpler to use, and far less dangerous.

Another example is C#''s use of Run-time type identification (RTTI). C++ effectively considers RTTI a dangerous thing to be avoided. Java makes significant use of RTTI/Reflection, and C# seems to positively revel in it, and you can see the Delphi roots of what Anders did in C#. The realization that it''s very helpful to investigate and manipulate types at run-time is one of the things that makes the IDEs so powerful. And the idea of attributes is very important. It took me awhile to understand these, but attributes have concepts in common with both aspects and metaclasses, and the root of all these ideas is an important addition to the way we think about programming.

Of course, the big problem with C# is that it is dedicated to a single platform. Yes, the Mono project is trying to port C#/.NET to Linux but I have my suspicions. Somewhere in there we will run across copyrighted APIs that can''t be re-implemented for Linux, and that''s where things will come to a halt. Sure, you can have the general stuff, but you won''t be able to write full cross-platform programs. I can''t see Microsoft giving away any strategic advantages, regardless of how badly they want to lure people back from Java.

One very good effect that C# has had is in providing competition for Java. JDK 1.5 already has a number of features that have clearly been inspired directly by C#. I''m very glad to see this, because it had begun to feel to me like the Java designers had lost the feeling that they had to serve my needs. With C#, they seem to be paying attention again.

Also, it is insteresting to see what the author of "Thinking in C++" actually thinks ABOUT C++:

At this point I''d have to say the primary strength of C++ is performance. That''s the only compelling reason to use it at this point, because the downsides are many -- the excessive complexity of the language and lack of garbage collection are the two biggest time-wasters. I still enjoy C++ as an intellectual puzzle; I keep learning from it. But I would be very reluctant to use it exclusively for a significant project, unless there was a constraint that required it.



AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Yeah, I would think Bruce Eckel would like C#. He previously complained about checked exceptions in Java and, like he mentions in that interview, the lack of operator overloading. Entirely subjective opinions on controversial subjects... nice that Microsoft built something for him too.

Personally I belong to the camp that disagree with him on those particular subjects, but I do agree with him about the benefits of competition.

This topic is closed to new replies.

Advertisement