From: gabriele renzi Date: 2005-12-23T03:42:50+09:00 Subject: Re: Bruce Eckel wouldn't know why to switch from Python to Ruby tony summerfelt ha scritto: > Doug H wrote on 12/20/2005 6:42 PM: > >>#python: > > >>#ruby: > > > is it just me or did that ruby code look a lot cleaner? I think everyone can agree :) But the python approach is maybe a little more pragmatic, in most use cases you'd write this in ruby: class Foo attr_accessor :foo def initialize foo @foo = foo end end end while in python it would be: class Foo: def __init__(slf,foo): slf.foo=foo relying on the fact that you could translate variable access into an accessor method when needed withouth breaking the interface. OTOH some hardcore-OO people could object that allowing access to instance variables by default may be a bad habit. tomayto tomahto, I'd say.