Class diagrams in UML (for my purposes) have boxes, two kinds of arrows (isa and hasa) between boxes, and methods, which are essentially strings, inside the boxes. Class diagrams correspond to object-oriented code in that each box probably has a section of code corresponding to it, each method probably has a section of code corresponding to it, and
(
Read more... )
So in either, it's natural to use polymorphism instead of if-thens. To use transparent forwarders and adaptors. They both profit from tail-call optimization. They should encourage a design style distributing knowledge and responsibility, with clarity about who does what ('trained animals' do the jobs). (OTOH Steve Yegge wrote this missive "Execution in the Kingdom of Nouns" blaming Java's bureacratic doubletalk style on object orientation, just what I'm claiming should nudge writers toward clarity, so I'm not sure. I think he misdiagnosed the problem, but then I don't read much Java and I'm not even sure how bad the problem is.)
OTOH, both formalisms in their really pure form get awkward on problems that get easier when you can look inside a thing, like with pattern matching, or any of a bunch of other language features that do exist for reasons.
I like the point about looking for one-method classes, and sketching algorithms for compiling either way. (Actually I'm leaning towards just focusing mainly on how to compile call-by-value lambda calculus and not trying to make the above parallels power a whole talk.)
Reply
Reply
Leave a comment