[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ruby
First off, let me apologize; it wasn't my intention to start an
antagonistic discussion on how bad one language or another was;
rather, I was simply trying to make a point about why Ruby failed
to appeal to me as much as it might have. Given the somewhat mixed
response, however, I feel that it might be best for me to clarify
and complete my original statements, just to avoid potential
misunderstandings.
> Gee, you really abandoned Java for such a small problem? Is that
> honestly your major problem with Java? Would you feel the same way
> about Smalltalk? Anyway, it has never bothered me. In the cases
> where there really isn't anything OO going on, which in my experience
> is usually groups of little utility functions, I just use static
> methods, with the class simply serving as a name scoping thing.
I'm still not convinced that OO is "the" design paradigm that all
software should be based on. Maybe I'm just dense, or the
specification and synthesis devotees I work with are finally
rubbing off on me.
Perhaps I should have elaborated more fully on my reasons for being
glad to have Java behind me for day-to-day programming tasks:
* static typing
* no interactive environment
* no closures, continuations, or tail-call elimination
* primitive numeric type/class instance divide
* awkward, limited standard string processing
* rigid, verbose syntax
I probably spent half of my time in Java trying to work around
these and other basic (admittedly deliberate) limitations in the
language. Certainly, most (if not all) of these problems can be
"patched" with an appropriate add-on or extension, but then I'm no
longer working in the standard Java that everyone knows and loves.
I do miss a some things from the Java world: some of the features
of the J2EE environment, such as container-managed persistence,
servlets, and message-driven objects, were actually quite nice. Of
course, I've since found equivalents to most of the really useful
bits in dynamic programming environments, and consider myself much
better off.
> I suppose if you often write very little script-like programs,the text
> overhead of the "class" statement might seem like a lot of characters
> to type; is that the issue? I guess I don't write programs small
> enough for that to be a problem.
Probably somewhere on the order of 75% of the code I write is
either a "very little script-like" program, or a prototype that may
never see use outside my workstation. That means I usually don't
want to fire up Rational Rose, grab the latest 'patterns' textbook,
and consult a wall full of inheritance charts just to get the thing
up and running.
Obviously, we're probably working on different types of systems,
but I think that the majority of code written *isn't* part of a
complex system, and suffers more from the lost productivity of
working in a statically typed, rigid language like Java than it
does from typing errors or poor organization.
Part of the problem, I guess, is that I just don't like putting
things into a class that have no part being there. Some things are
better modeled as a simple package of functions, a procedural
script, a meta-class, etc., none of which can be first-class
citizens in standard Java.
When I need an 'architecture,' or something that I can hand off to
a new programmer, though, I can take my lumps and "do the right
thing" -- which in the above cases usually means writing the least
clever, most over-engineered, and least-dynamic system I can. The
rest of the time, I'm lucky enough to get to work with dynamic
languages, create compact, intelligently-written code, and use a
variety of abstraction techniques.
> I do agree that it's best to have the best of both worlds, which
> I think Lisp-with-CLOS gives you. (I don't know Ruby at all so
> I can't comment on it.)
Ruby is certainly more dynamic than Java, but is much more
pervasively object-oriented than, say, Python or Scheme. One
feature of the language which I haven't been found a good
explanation of yet is the meta-object model, though there are
tantalizing references to it several places online.
In essence, I'm just fickle. To put my own spin on your CLOS
comment, I think it's best to have the choice of *all* worlds, or
at least as many as are practical. I don't need the language I'm
working in to artificially constrain the available semantics of my
code just to protect me from "difficult" designs.
Object-orientation is one technique available, and is often a very
helpful addition to my toolkit.
Again, my apologies for the digression; I'll try to move forward
from here on out, instead of stepping back to re-explain myself.
Lennon Day-Reynolds
- References:
- Re: ruby
- From: Dan Weinreb <dlw@exceloncorp.com>