[email protected] wrote:
when I can understand a concept, test it and see that it works. How do
-a
Probably true.
But I am finding I can’t really do much writing of the code, or driving
of the
car until I’m upwards of pages 120. Contrast this with the first Perl
Book I
had from O’Reilly and it’s a bit frustrating. Sorry about the perl
analogy but
it’s my best and most recently used language.
I’m badly hung up on trying to find out things like:
variable scope.
declaration.
loops/branches/control_structures.
They are presented in bits and pieces with a lot of forecasted
references (if
you want to know the details about ‘xxx’ see pages ‘…’) which makes
for a LOT
of page turning.
Because of the extensive differences between Ruby and where many people
will be
coming from, I would think more time spent on the pre-conditions of
writing code
would be helpful. I don’t understand the framework for writing the
language.
As a specific example (again contrasting to Perl) the introduction of
objects
and method from external objects or files is going to be required much
sooner in
Ruby than it will with Perl. But it’s not really explained until quite
a
distance in the book that, unlike perl, a filename doesn’t match the
modulename
or object you are loading. Perl would use something like Time::HiRes to
pull a
module into the code where Ruby would use something like ‘time’ or
‘hires’ or
some path implied string like ‘time::hires’.
But the module has little of any bearing on the objects affected and the
name
used in the require statement is not going to match the name found on
your
filesystem. These inconsistencies, by not being pointed out and
addressed
specifically, have lead to enormous frustration and a very bad first
impression
of the language (being immature and inconsistent). Inconsistencies at
this
level can be very scary to a newbie.
It was past page 100 that I found out that the subject of scope was not
the same
as what I would have expected after decades of programming in other
languages.
This was another nasty surprise. And after 100 pages of other stuff.
This
explained a lot of problems I was finding in my code that I was playing
with.
I realize that I’ve biasedly presented these two issues as problems with
the
ruby language. Well, I can do that because I’m too new to know any
better and I
have yet to “see the light” on why this is a good thing in contrast to
all my
experiences so far in life. From my background, SCOPE is a flaw and
non-strict
pragmas is a condition to be aware of when tracking bugs. But like I
said, I’m new.
I am reminded of the Monty Python skit where the Inspector was going on
about
the sweet titled “Crunchy Frog” and that, since it contained real live
dead
unboned dead frogs lightly killed and lovingly coated in sucrose that
the box
should contain a large red label “CAUTION: Real Live Unboned Dead Frog”.