Whither SmallScript? (was Re: Integer micro-benchmarks)
Andrew Hunt
andy at toolshed.com
Mon Apr 30 10:38:10 EDT 2001
On Fri, 27 Apr 2001 14:02:27 -0400,
Steven D. Majewski <sdm7g at Virginia.EDU> wrote:
>
>
> On Fri, 27 Apr 2001, Andrew Hunt wrote:
>
> > I personally like the style and dynacism of Ruby. For instance, to declare
> > a class that inherits from another class you simply have:
> >
> > class Foo < Bar
> > def myMethod
> > File.new ("test.dat", "w") { |f|
> > f.puts "Hello world!"
> > }
> > end
> > end
>
> What do the vertical bars around the f ("|f|") above indicate ?
A local variable to the block, used to pass the parameter from File.new.
> ( Maybe it's those extra non alphanumeric operator looking chars
> that make folks think of Perl -- even if they are used differently,
> to someone that doesn't read Ruby, it looks like more "line noise".)
Doesn't Smalltalk use vertical bars as well? I don't think that
qualifies as line noise. The @-prefix on instance variables might,
and I'll admit to not liking that very much when I first saw Ruby.
However, most Java or C++ programs I've seen tend to use *some* sort
of naming convention for instance variables, either myFoo or _Foo or
something like that. Given the choice between myFoo and @foo, I'll
take @foo.
/\ndy
More information about the Python-list
mailing list