Re: What databases have taught me

From: Marshall <>
Date: 23 Jun 2006 08:37:03 -0700
Message-ID: <>

[changed followup to comp.database.theory-- I have crosspost fatigue.]

Kenneth Downs wrote:
> Marshall wrote:
> > JOG wrote:
> >>
> >> - I started life as a procedural programmer.
> >> - I adopted OO and soon got the 'aha' click described by R. Martin.
> >> - I spent years coding large OO projects, with beautiful, elegant
> >> architectures.
> >> - I spent further years practically gnawing my arm off attempting to
> >> adapt my perfect OO designs as requirements inevitably shifted and
> >> exceptions arose.
> >> - I finally realised that my 'aha' was utterly illusionary, and that my
> >> code, being OO, was inevitably and irrecovably imprisoned in a
> >> hierarchical strait-jacket
> >
> > Nice post!
> >
> > The progression you describe above is pretty much exactly the
> > progression I went though as well.
> >
> Where did this lead you to Marshall? Can you give your "elevator speech"
> about how you develop now in your post-OO mindset?


I was hanging out with a guy at work, during a period where I was still pretty much a Java bigot. When I would assert this or that about how great Java was, he'd write a proof on a whiteboard of some aspect of it being unsound. A proof!

After getting interested in programming languages, I started reading about as many as I could find. Haskell, SML, O'Caml, prolog, lisp, J, K, Sather, Eiffel, scheme, ruby, python, erlang, epigram, etc.

Reading about Haskell, I came across the page that compares the C version of the quicksort function to the Haskell one. That blew my mind! I knew about using the RM in a declarative way, but I had no idea that *code* could be so declarative.

Of the various languages, the family that impressed me the most was the functional family, specifically Haskell and SML. These are languages that actually have a formal basis, rather than just a prose spec. The also emphasize a purely functional style of coding. That is, functions are real mathematical functions, in that their return value depends only on their paramaters. Also, these languages emphasize the use of higher-order functions, which are functions that take functions as parameters and/or return functions as results.

Now, I still program in Java, because it's what I'm most familiar with, and because it's not too bad, and because the tools for it are great. But I use a very different style than I have in the past.

Every possible class that can be a value class, is. That is, the class is parameterized only in the constructor; there are no mutators or setters; every field is final.

I make much larger use of tiny objects as if they were functions. I might have a one-method interface, and dozens of one-method objects that implement that interface. Then I use them in a functional style. (For a while I was using anonymous classes for this, but the debugging support for anonymous classes is bad, so I started giving these classes a semi-gratuitous name.)

I make only a little use of inheritance, mostly as a way to facilitate polymorphism.

What I *dream* of, though, is a language that will have built-in, both the functional facilities of a languages like SML and the relational algebra, together. Since no one seems to be working on this, I'm toying with it myself.

Marshall Received on Fri Jun 23 2006 - 17:37:03 CEST

Original text of this message