On Apr 27, 2010, at 11:28 AM, Kevin Wright wrote:

The latest draft document on the design of scala.swing isn't bad: http://www.scala-lang.org/sid/8 , through it doesn't show much beyond the use of closures/function pointers.

Yes - I'm a fan of scala, except that I wish it were more coherent and consistent in syntax. That's a personal nit though.

Even more interesting is this document on "Deprecating the Observer Pattern", which really does bring the full power of FP to the problem, including delimited continuations: http://infoscience.epfl.ch/record/148043/files/DeprecatingObserversTR2010.pdf
[warning: pdf]

I've come to the conclusion that FP is a degenerate case of the Observer pattern - which is why Clojure works so nicely in an object- oriented bytecode virtual machine.

And there's JavaFX of course! All of these are very definitely using functional elements in their design, although the need to interact with Swing is understandably going to restrict the possibilities here (less so in the deprecating observers document)

Yep. All of this is awesome. And starts to make up for some of Java's flaws. We're working on a side project called "noop" which is a different take - trying not to push the limits of software language theory, but to design a language that fits some constraints of what we've learned about software applications and patterns people use/ abuse. These are all great, and I might like some of these almost as much as Objective-C. Add in AOP features and I feel you've surpassed it. (see, I'm not just a fanboi ;-)

In Scala I've certainly used a lot of functional thinking to implement designs: - pattern-matching to select the appropriate behaviour in response to an event - use of a function-pointers and closures to define an event handler (no clunky xxxListener interface needed) - map and flatmap to implement component models in terms of other collections
- higher-order functions

Yes - I do like how you can think O-O AND functionally in a mixed environment in Scala. that's what I found with Objective-C as well, but you can go typeless in Objective-C (the id pointer type with selectors) which is harder in Java/Scala/etc. But that could all be implemented.

plus actors, though these aren't strictly speaking unique to functional programming.

Yeah - I like this paradigm - we're looking at this for noop too. (oh, ironically, we've implemented most of the early interpreter for noop in scala)

The point is that "best OO" still leaves a lot of other things to be good at, it's by no means the end of the game! It would therefore be a real shame if OO were the only realistic language-supported option available to me (i.e. C++/objective C), and that has now become the sad but unavoidable truth for iGadget development.

Also agreed. Yeah - my point, as I said, is not to defend apple's decision - it was to object to the kinds of statements people are reflexively making about Objective-C because of (what I perceive to be) fundamentally emotional reactions to Apple's stupidity, being taken out on a language that has, frankly, produced high-quality software for over two decades. One might argue that it only recently changed because it didn't much need to - it already had mixed OO/ functional capabilities, a dynamic runtime with typeless/typed options, a really workable set of base-classes and application classes with a nice GUI builder to assemble them (without generating code to be maintained), AOP capabilities, and, with 2.0, garbage collection. Most of the actual arguments are stylistic. It's a thoroughly modern language in most respects... it's its style and position in history and industry and fashions in software development which have relegated it to perceptions of antiquity. I would argue that most of Java's "evolution" was "fixing what had been broken from the beginning" so we finally get somewhere workable. And since I was in Javasoft around the time of Java 1.1, I have some credibility on that point.

Being one of the "best OO programmers" a person knows is a worthy achievement and something to be quite rightly proud of. Then again, so is "best COBOL developer".

This is absolutely true, and I've met some damned great assembly and Forth programmers whom I have nothing but respect for.

cheers,
Christian.

--
You received this message because you are subscribed to the Google Groups "The Java 
Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to