[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT: well bred language [was RE: refactoring when using CVS]

From: Greg A. Woods
Subject: Re: OT: well bred language [was RE: refactoring when using CVS]
Date: Wed, 27 Feb 2002 16:31:19 -0500 (EST)

[ On , February 27, 2002 at 14:00:24 (-0600), Mark A. Flacy wrote: ]
> Subject: Re: OT: well bred language [was RE: refactoring when using CVS]
> Ruby?  With the Perlish syntactic trash like...
>   "It uses simple naming conventions to denote the scope of
>    variables. Examples: simple 'var' = local variable, '@var' = instance
>    variable, '$var' = global variable. So it is also not necessary to use a
>    tiresome 'self.' prepended to every instance member."
> ...?
> No thanks.

I think you're confusing useful and simple syntactic elements used to
enhance the language with all the other garbage Perl throws at you.

Ruby really is almost fully 100% OO, just like Smalltalk, and unlike
even Python-2.x, perl-6, etc.

In Smalltalk "variables" have to be defined in separate places (class
and instance variables, pool dictionaries, etc. have to be defined in
the class), which makes it a bit harder for a clean presentation in a
language represented with linear ASCII text.  If you've ever read the
export format of your average Smalltalk implementation, or even the more
informal mechanisms used in some books, then you will begin to see what
I mean.

In Smalltalk you also have to resort to naming conventions and
capitalisation styles to give hints to the casual reader about the scope
of a variable.  In Ruby because of this enforced and very standardised
naming convention you can immediately tell the scope of a variable just
by looking at its name, anywhere, anytime.

One weird thing in Ruby is that it's got some vestiges of algol-like
syntax and semantics, no doubt required in order to make it a useful
scripting language that can be used even from the command-line.  It does
make it very easy to use in an awk-like manner (actually it's even
easier for some kinds of tasks since it can expect the code to be on
stdin, not the data).

The perl-ish things I really don't like about Ruby are these:

        - variable/method ambiguity (identifiers are assumed to be
          method calls unless an assignment to the identifier appears
          previously in the source file, which means a subsequent
          assignment to an identifier that's also defined as a function
          can cause strange things to happen)

        - the "block" avoidance allowed by forms of conditional
          statements such as:

                foo(bar) if i < 1
                a = a+1 while a < 1000

           Perl didn't invent this form of conditional, but it sure as
           hell made it _WAY_ too popular.  yuck.

                                                                Greg A. Woods

+1 416 218-0098;  <address@hidden>;  <address@hidden>;  <address@hidden>
Planix, Inc. <address@hidden>; VE3TCP; Secrets of the Weird <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]