Bruce Eckel wouldn't know why to switch from Python to Ruby

... be careful, you're gonna bring down the python coding police ...

Although not a physical requirement of the runtime, you named your first
variable in the class method slf ... the python community would eat you
alive for that ...

They prefer ( and *ALL* their docs make sure to tell you over and over )
that the first parameter of the class method be named self.

... Dive into python and every other tutorial on the topic actually stops to
make sure you understand this ...

I find it humorous ... and a bit retentive ... but, to each their own.

j.

···

On 12/22/05, gabriele renzi <surrender_it@-remove-yahoo.it> wrote:

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 :slight_smile:

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.

--
"Remember. Understand. Believe. Yield! -> http://ruby-lang.org"

Jeff Wood

Argh. It looks unfinished. It's asymmetrical, and not in a beautiful
way.

It's shorter than the Ruby example, but it makes my eyes bleed. An
episode of The Apprentice is shorter than The Maltese Falcon, too, but
it's a hell of a lot uglier.

. . . at least, for my taste.

When I want short code, I write it in Perl.

···

On Fri, Dec 23, 2005 at 03:42:50AM +0900, gabriele renzi wrote:

while in python it would be:
class Foo:
  def __init__(slf,foo):
   slf.foo=foo

--
Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]

unix virus: If you're using a unixlike OS, please forward
this to 20 others and erase your system partition.

Chad Perrin ha scritto:

···

On Fri, Dec 23, 2005 at 03:42:50AM +0900, gabriele renzi wrote:

while in python it would be:
class Foo:
def __init__(slf,foo):
  slf.foo=foo

Argh. It looks unfinished. It's asymmetrical, and not in a beautiful
way.

It's shorter than the Ruby example, but it makes my eyes bleed. An
episode of The Apprentice is shorter than The Maltese Falcon, too, but
it's a hell of a lot uglier.

. . at least, for my taste.

When I want short code, I write it in Perl.

de gustibus non est disputandum

Jeff Wood ha scritto:

.. be careful, you're gonna bring down the python coding police ...

Although not a physical requirement of the runtime, you named your first
variable in the class method slf ... the python community would eat you
alive for that ...

They prefer ( and *ALL* their docs make sure to tell you over and over )
that the first parameter of the class method be named self.

.. Dive into python and every other tutorial on the topic actually stops to
make sure you understand this ...

I find it humorous ... and a bit retentive ... but, to each their own.

j.

you're absolutely right, but in my defense I can say that I did write that becuase I feel the need to explicitly name self dumb. I find it ok to write self.foo but naming the argument is just useless imho.

Um. Okay?

···

On Fri, Dec 23, 2005 at 12:17:50PM +0900, gabriele renzi wrote:

Chad Perrin ha scritto:
>On Fri, Dec 23, 2005 at 03:42:50AM +0900, gabriele renzi wrote:
>
>>while in python it would be:
>>class Foo:
>> def __init__(slf,foo):
>> slf.foo=foo
>
>
>Argh. It looks unfinished. It's asymmetrical, and not in a beautiful
>way.
>
>It's shorter than the Ruby example, but it makes my eyes bleed. An
>episode of The Apprentice is shorter than The Maltese Falcon, too, but
>it's a hell of a lot uglier.
>
> . . at least, for my taste.
>
>When I want short code, I write it in Perl.

de gustibus non est disputandum

--
Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]

unix virus: If you're using a unixlike OS, please forward
this to 20 others and erase your system partition.

Chad Perrin wrote:

···

On Fri, Dec 23, 2005 at 12:17:50PM +0900, gabriele renzi wrote:

Chad Perrin ha scritto:

On Fri, Dec 23, 2005 at 03:42:50AM +0900, gabriele renzi wrote:

while in python it would be:
class Foo:
def __init__(slf,foo):
slf.foo=foo

Argh. It looks unfinished. It's asymmetrical, and not in a
beautiful way.

It's shorter than the Ruby example, but it makes my eyes bleed. An
episode of The Apprentice is shorter than The Maltese Falcon, too,
but it's a hell of a lot uglier.

. . at least, for my taste.

When I want short code, I write it in Perl.

de gustibus non est disputandum

Um. Okay?

We Germans say "Über Geschmäcker kann man streiten" - interestingly enough
it's the negated translation of the Latin "You cannot argue about
likings"... :slight_smile:

    robert

Four years of high school (although that was sometime ago now) to the rescue:

In matters of taste there can be no dispute.

Colloquially in English: you say potato, I say potato :slight_smile:

···

On 12/22/05, Chad Perrin <perrin@apotheon.com> wrote:

On Fri, Dec 23, 2005 at 12:17:50PM +0900, gabriele renzi wrote:
> Chad Perrin ha scritto:
> de gustibus non est disputandum

Um. Okay?

Is de gustibus non est disputandum Italian, Latin or something else?
I can think of many threads I'd like to use that phrase in.

SteveT

Steve Litt

slitt@troubleshooters.com

···

On Friday 23 December 2005 09:40 am, Patrick Hurley wrote:

On 12/22/05, Chad Perrin <perrin@apotheon.com> wrote:
> On Fri, Dec 23, 2005 at 12:17:50PM +0900, gabriele renzi wrote:
> > Chad Perrin ha scritto:
> > de gustibus non est disputandum
>
> Um. Okay?

Four years of high school (although that was sometime ago now) to
the rescue:

In matters of taste there can be no dispute.

Colloquially in English: you say potato, I say potato :slight_smile:

latin.

···

On 12/23/05, Steve Litt <slitt@earthlink.net> wrote:

On Friday 23 December 2005 09:40 am, Patrick Hurley wrote:
> On 12/22/05, Chad Perrin <perrin@apotheon.com> wrote:
> > On Fri, Dec 23, 2005 at 12:17:50PM +0900, gabriele renzi wrote:
> > > Chad Perrin ha scritto:
> > > de gustibus non est disputandum
> >
> > Um. Okay?
>
> Four years of high school (although that was sometime ago now) to
> the rescue:
>
> In matters of taste there can be no dispute.
>
> Colloquially in English: you say potato, I say potato :slight_smile:

Is de gustibus non est disputandum Italian, Latin or something else?
I can think of many threads I'd like to use that phrase in.

SteveT

Steve Litt
http://www.troubleshooters.com
slitt@troubleshooters.com

--
"Remember. Understand. Believe. Yield! -> http://ruby-lang.org"

Jeff Wood

Oops that was supposed to be four years of high school latin :slight_smile:

···

On 12/23/05, Steve Litt <slitt@earthlink.net> wrote:

On Friday 23 December 2005 09:40 am, Patrick Hurley wrote:
> Four years of high school (although that was sometime ago now) to
> the rescue:

[snipped]

Is de gustibus non est disputandum Italian, Latin or something else?
I can think of many threads I'd like to use that phrase in.

Quidquid latine dictum sit, altum viditur. [*]

SteveT

* I don't know Latin but my buddy Google does.

···

* Steve Litt (slitt@earthlink.net) wrote:

--
Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

E rubimus codimus

SteveT

Steve Litt

slitt@troubleshooters.com

···

On Tuesday 27 December 2005 08:49 pm, Paul Duncan wrote:

* Steve Litt (slitt@earthlink.net) wrote:
[snipped]

> Is de gustibus non est disputandum Italian, Latin or something else?
> I can think of many threads I'd like to use that phrase in.

Quidquid latine dictum sit, altum viditur. [*]

Carpe rubium.

Et tu, Ruby?

Okay, never mind. Forget I said anything. That was really bad.

···

On Wed, Dec 28, 2005 at 02:51:35PM +0900, Steve Litt wrote:

On Tuesday 27 December 2005 08:49 pm, Paul Duncan wrote:
> * Steve Litt (slitt@earthlink.net) wrote:
> [snipped]
>
> > Is de gustibus non est disputandum Italian, Latin or something else?
> > I can think of many threads I'd like to use that phrase in.
>
> Quidquid latine dictum sit, altum viditur. [*]

E rubimus codimus

--
Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]

This sig for rent: a Signify v1.14 production from http://www.debian.org/

Chad Perrin wrote:

Carpe rubium.

Et tu, Ruby?

Okay, never mind. Forget I said anything. That was really bad.

Quondo Omni Flunkus Utor Ruby

(with apologies to Red Green fans :slight_smile: