ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulo Gaspar" <Paulo.Gas...@krankikom.de>
Subject RE: C# (was: aspectJ (was Re: [PATCH] build events))
Date Fri, 30 Jun 2000 19:43:19 GMT
> -----Original Message-----
> From: James Sieben (EUS) [mailto:EUSJASI@am1.ericsson.se]
> Sent: Wednesday, June 28, 2000 8:46 PM
> To: 'ant-dev@jakarta.apache.org'
> Subject: RE: C# (was: aspectJ (was Re: [PATCH] build events))
>
>
> 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.

Delegates are also a Delphi idea (if I am undesratngin right). They can make
easier to reuse an implementation in a more elegant way than multiple
inheritance. (For a given class you delegate the implementation of an
interface to an enclosed object of a class that has some sort of standard
imlpementation. You may that reimplement that interface in many classes with
that specialized inner class.)
It is useful for some COM constructions too.

> 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.

That is easy to understand for a Delphi programmer. I think it is the part
that as more to do with Delphi in the all spec.
In Delphi you have "public", "protected" and "private" access specifiers
that
work in a similar way to the C++ ones. But, although there are no "friends"
in Delphi, it happens that "private" members can be accesed by any code in
the same unit.

Now, making access easy to auxiliar code in the same module is sometimes
nice,
but other times you want to put some discipline and you have to resort to
something like renaming a variable to have the compiler helping you to
ensure
that it is not being accesses from outside the class code alone.

The private+internal pair solves this dilema.

As I said, it has a lot to do with Delphi way of thinking.


> Finally, why do they make a big deal out of versioning?
> ...
> Why the language level features to do this?

I guess they want to fight some typical COM problems with that. Remember
that
Java interfaces are used by Java code alone, but COM interfaces...


> I really really like the syntax for accessors/mutators. It's such a
> pain to write all those methods by hand in Java...

That is my favorite feature. Even more elegant than Delphi, which is nicer
for the simplest cases (property=variable with no side effects) but not so
much for the others.


Have fun,

Paulo Gaspar
(paulo.gaspar@krankikom.de)



Mime
View raw message