Re: Is Ruby On Rails, Delphi's lost cousing?



Barry Kelly wrote:

"Paul Nichols (TeamB)" <paul@xxxxxxxx> wrote:

C# is nothing more than a Java clone.

Begging your pardon, but I've programmed for several years in both
languages and I far prefer C# - especially C# 2.0, with anonymous
delegates. The closest analogue in Java is anonymous classes, but they
don't capture variables in the same way (i.e. no non-final values
captured) and they end up more verbose. Delegates as a first-class
language feature alone makes me happier using it.

You can do the same with Java using inner classes and reflection and
introspection. In fact, I have a library that gives me the same
functionality. No biggie.

There are things you get with this first-class support like covariance
of return type and contravariance of parameter types in implicit
conversions of method groups to delegate-typed values that you don't get
easily using something analogous in Java that works with classes
instead.

I would agree. Java Mustang does have some of this same functionality.

d parameters, has fundamentally changed the way I program.

Another thing is the synergy between iterators, generics and foreach.
One can find all kinds of imaginative uses for IEnumerable<T> that don't
involve collections, given how easy it is to implement IEnumerable<T> -
you don't even have to write a class. This can bring functional language
ideas in. For example, given an IEnumerator<char> e, I've written some
things:

---8<---
Algo.SkipWhile(e, char.IsDigit);
// ...
Algo.SkipWhile(e, Algo.Not(Algo.Equals('\n')));
--->8---

Where Algo.Not and Algo.Equals return values of type Predicate<T>.


Look at Java 1.5. This type of functionality is available in Java. The
enhanced for loop takes care of a lot of these considerations.

Autoboxing takes care of many of these differences as well.
.



Relevant Pages

  • Re: java.util.zip Limitations
    ... > fundamental disagreements with OOP and the direction Java is taking. ... > language, believing less is more. ... It has some nasty kludges due to early design ... > The functionality I added in myZipFile class, ...
    (comp.lang.java.programmer)
  • Re: Is Ruby On Rails, Delphis lost cousing?
    ... The closest analogue in Java is anonymous classes, ... Delegates as a first-class ... language feature alone makes me happier using it. ...
    (borland.public.delphi.non-technical)
  • considering ideas for a new language
    ... I am now considering a few ideas for a new scripting language (for use in my ... so the language/vm may include functionality to ... I am considering making it in many ways resemble java. ...
    (comp.lang.misc)
  • Re: Comparing Lisp conditions to Java Exceptions
    ... All the ISO standards in the world will not make the world ... Nothing keeps you from annotating your program with exceptions based on what ... language should adhere to your theory. ... Curiously, although you don't say it, Java has the opposite problem. ...
    (comp.lang.lisp)
  • Re: casts
    ... This is why most shit programmers refuse to learn languages including ... C Sharp and Java. ... compiler in a later edition of Visual Basic, ... language for processing data. ...
    (comp.lang.c)