ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Sieben (EUS)" <EUSJ...@am1.ericsson.se>
Subject RE: C# (was: aspectJ (was Re: [PATCH] build events))
Date Wed, 28 Jun 2000 18:46:26 GMT
I looked over the spec, and posted a short review to slashdot
(http://slashdot.org/comments.pl?sid=00/06/26/1935256&cid=193) . Briefly,
here are my thought:

While C# does have a few nice tidbits, its really nothing new. Java brought
a lot mroe dynamic binding to the table with Reflection and custom class
loaders and the like. There's no evidence of any of this extraordinarily
useful stuff.

Boxing/Unboxing is sort of interesting, but its too early to tell how well
it works, etc. I do like having the language do the silly "new Integer(3)"
and "Integer.valueOf()" stuff for you, but who knows if the performance
penalty is too great, or if there are other complications as well. Someone
did note that this doesnt work perfectly, since you can't subclass the
"boxed" types, to make things mroe extensible. That is something I wish you
could do in Java, without having to do all the work yourself: store a
"Numeric" object in a Collection, and then allow it to be a Double, Long,
Integer, etc... all at compile time. Oh well. Nothing major though.

Similarly, the syntactic sugar present in the language is kind of nice. I
particularly like the getters/setters syntax and the indexed propertoes
syntax. While it is true that it can lead to some nasty side effects going
on, I think it makes the language more expressive. Sometimes Java can get
sort of bland to me (all the Object.getValue() Object.setValue() stuff).
That is an aspect I liked of Delphi very very much. foreach is similarly
useful and expressive, but again nothing new. 

The language support of Delegates is kind of interesting, but it also seems
sort of redundant. This all can (and is, in Java) accomplished with proper
use of interfaces. Having constructs to do it makes things a little easier
to understand, but adds to the complexity of things I think.

However, theres lots and lots of things in there that are reallyt just a
throwback to C/C++. Like the inclusion of structs. I understand they are for
performance reasons, but why not just optimize the C# equivalent of a final
class (I think they called it 'sealed') to do the same things? Why have an
entire construct that eliminates the advantages of OOP?

The unsafe code blocks are also questionable. I guess they are trying to
position this as being THE language for Windows development (which isn't
that bad of an idea really, since C++ on Win32 is heinous.) But it seems
like you could do the same thing, but cleaner, with something like JNI for
C#. What's more, all the objects automatically become COM objects (that is
kind of neat) so why not just use those for "unsafe" code, coded in C to get
full speed out of the machine in the first place?

C# also seems to have a proliferation of modifiers and extraneous keywords.
Like the 'internal' thing. It wasn't 100% clear what it meant, and I don't
know how useful it would be. I am glad Java pulled the 'private protected'
or whatever it was early on. Multi-word keywords like C#'s protected
internal are confusing.

Similarly, they added something called Atributes that seems to let you
specify your own programmable modifiers? But it isnt documented well, and
thus I couldn't make heads or tails of it. I did gather that it seems to be
syntactic sugar for COM interfaces, but its quite nebulous. I dont know what
to make of it. It does look very exoressive though, but at what price?

I'm disappointed with the presence of a preprocessor. What a way to
introduce clutter into everything.

Finally, why do they make a big deal out of versioning? Without saying it,
they seemed to directly confront Java's way of dealing with changing classes
and such. I don't understand what the problem is with the way Java works
now. I know that in all my years of Java and C++ coding, I've never run into
a problem where I derived from a class, wrote a method, and then the next
version of the base class introduced a similarly named method. It just
doesn't seem to be that big of a deal to me. Why the language level features
to do this?

All in all, theres some useful bits in there, but most of that is nothing
new. I really really like the syntax for accessors/mutators. It's such a
pain to write all those methods by hand in Java (though mature IDEs do help
with that these days.) But other than that, it just doesn't seem that big of
a deal. Theres lots of cruft still left in it....trying to win over the
hordes of C/C++ people by leaving the bad features in is just a mistake I
think.

-----Original Message-----
From: Paulo Gaspar [mailto:Paulo.Gaspar@krankikom.de]
Sent: Wednesday, June 28, 2000 1:00 PM
To: ant-dev@jakarta.apache.org
Subject: RE: C# (was: aspectJ (was Re: [PATCH] build events))


Yeah, I would call it "C pound" or "C heavy" instead of "C sharp".
It is not that small and simple anyway.

But, it is not just a Java inspirde language. It has Delphi 
influences too:
- In Delphi one must use the "override" (instead of "overrides") 
  keyword to override a method, making the overrideing explicit. Of 
  course that M$ never mentions Delphi on their pages and only 
  compares that feature to Java and C++ in the front marketing page;
  http://msdn.microsoft.com/vstudio/nextgen/technology/csharpintro.asp
- The "using" (to use a module) is quite similar to the "uses"
  keyword in name and functionality. "Uses" is already old Borland
  Turbo Pascal stuff (version 4);
- and the indexed properties... etc.

That influence is obvious too, since the architect of C# (Anders 
Hejlsberg) was part of the initial Delphi team. 

And the Delphi team sure knew Java since the start, as it gets obvious 
by analizing some of the language features - like interfaces and 
interface inheritance, that are similar even in declaration syntax 
(the inheritance declaration, I mean).


Anyway, a competent language designer usualy knows many languages. 

And I even like the language as having several improvements over C++, 
Object Pascal and, arguably (because of low level stuff being 
possible) Java. (Althought I would not allow any implicit type 
conversions, even if declared).


Of course that you CAN NOT expect platform independence from M$. 
Especially, you can not expect independence from COM/ActiveX. That
was the start of the end of Java in M$, remember?


Have fun,

Paulo
(paulo.gaspar@krankikom.de)



-----Original Message-----
From: Stefano Mazzocchi [mailto:stefano@apache.org]
Sent: Wednesday, June 28, 2000 12:29 PM
To: ant-dev@jakarta.apache.org
Subject: Re: aspectJ (was Re: [PATCH] build events)



<rant about="Microsoft C#">
C# is the most incredibly obvious Java-clone in existance. They claim it
was invented only with experience from C/C++ but do you believe that?
They cloned everything and they even got it WRONG!! Look at namespaces,
look at pointer availability.

C# is the ultimate macro virus language. They have no notion of
security, no notion of sandboxing, no notion of platform abstraction (of
course not!).

And they add _nothing_ that Java doesn't have today (well, to be honest,
only one thing "class versioning" which is something I'd expect the JCP
to talk about soon).
</rant>




Mime
View raw message