Re: Why not Python? (No, no, I am not a spy)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Vivek Krishna
I am not really experienced in python but somehow the  whitespace
indentation  philoplosophyt of python puts me off. I know lots of
people have argued that you get used to it but you got to get started
to get used to it. ;- ) I started ruby because I wanted to learn rails
and I have found it to have all the features of perl and I guess ( I
have read elsewhere) it has the clean syntax and readability of python.

The best part about ruby i like is the ability to dynamically add new
methods with things like "method_missing" ..I think ruby does this kind
of meta-programming in the cleanest way.


Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Jim Freeze-2
On 12/22/05, Vivek <[hidden email]> wrote:
> I am not really experienced in python but somehow the  whitespace
> indentation  philoplosophyt of python puts me off. I know lots of
> people have argued that you get used to it but you got to get started
> to get used to it. ;- ) I started ruby because I wanted to learn rails

I've heard this mentioned and assume it is true, but maybe the Python
guys have a way around it...but doesn't Pythons space dependence
preclude one from writing a erb type app with Python?

<?= for i in some_array; do_some_function; end ?>

Or is it that you could do that, but just not write code inline:

<?=
  for i in some_array
    do_some_function
?>

Just wondering.

--
Jim Freeze

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

pauld-2
In reply to this post by Vivek Krishna
I actually recently tried to pick up Python, by reading 'Dive Into
Python', which got quite good reviews on Amazon.  And I did this mainly
because Ruby is so easy, I thought maybe my brain is getting flabby.
Ruby is Easy.  Almost too easy.  Long story short, after trying to
learn Python syntax, I found that it was not for me.  I was putting in
a lot of effort (perhaps the point of it all), with little return.
Stuff that 'just works' in Ruby seems to take a lot of unnecessary
effort elsewhere.  Ruby seems to have been written to ease the burden
off the programmer, and almost every other language doesn't (in
comparison).  SImilar effort put into Python, or God forbid, VB (or
whatever it's called now), yields so much less.  Perl is a little too
messy, Python not messy enough... Ruby is just right.  It seems to know
what my brain wants in a programming language.


Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Gene Tani
In reply to this post by Vivek Krishna

Tolga wrote:
> First of all and very first of all, I must state that I am not an enemy
> or a spy :-D
>

I don't have much to add, you can google for 750 k hits for "ruby vs
python" and read what people have written on c2.com and artima.com
"your interpreter/VM/lang spec/dev environment is strap-on OO, pass by
reference, weakly typed, weakly lexically scoped, inconsistent API,
writing C extensions sucks and it's slow"

Alex Martelli wrote this, which i think is the best summary to date
http://groups.google.com/group/comp.lang.python/browse_frm/thread/40d8d11e12cb00ba/ac369f0960495acd?q=martelli+%22python+vs.+ruby%22&rnum=1#ac369f0960495acd

And, just as an observation, i find myself regularly downloading stuff
from CPAN and either rewriting chunks in ruby, or running perl.
Neither python or ruby has anything of that magnitude. (Even after 10+
years of on and off perl use, I find it difficult to read the O-O
stuff,) but ability to read perl will serve you well.


Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Gene Tani

Gene Tani wrote:

>
> Alex Martelli wrote this, which i think is the best summary to date
>

wrong link, sorry:
http://mail.python.org/pipermail/python-list/2005-October/305692.html


Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Jeff Wood
Yep, that is a great link.

And pretty darn'd accurate ...

j.

On 12/22/05, Gene Tani <[hidden email]> wrote:

>
>
> Gene Tani wrote:
>
> >
> > Alex Martelli wrote this, which i think is the best summary to date
> >
>
> wrong link, sorry:
> http://mail.python.org/pipermail/python-list/2005-October/305692.html
>
>
>


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

Jeff Wood
Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Steve Litt-2
In reply to this post by Gene Tani
On Thursday 22 December 2005 11:07 am, Gene Tani wrote:

> Tolga wrote:
> > First of all and very first of all, I must state that I am not
> > an enemy or a spy :-D
>
> I don't have much to add, you can google for 750 k hits for "ruby
> vs python" and read what people have written on c2.com and
> artima.com "your interpreter/VM/lang spec/dev environment is
> strap-on OO, pass by reference, weakly typed, weakly lexically
> scoped, inconsistent API, writing C extensions sucks and it's
> slow"

If you read between the lines in this thread, you notice that only
Python and Ruby are mentioned in positive light. Nobody stood up
for Perl, or VB, or Pascal, or C++, or Java. Ruby and Python have
obviously done something right, well beyond the convenience and
capabilities of other languages of our time.

I've used Perl since 1997, and fell so in love with Perl that my
wife hired a private investigator, but since I've found Ruby, Perl
seems so, well, so 1997. For me, life's too short to use anything
but Ruby or Python in typical small to moderately sized programs
that aren't extremely computation heavy (simulation and the like).

SteveT


Steve Litt
http://www.troubleshooters.com
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Jeff Wood
Actually, the one comparison that gets touched on a bit too lightly ... is
the community...

The python & ruby communities are VERY different.  The above article glasses
over it by saying:

"The Python is harder to get into because it's larger than the ruby
community" ...

Well, uh, no, that's not true ...

... I won't go into details or start name-calling ... but, go into a chat
room for either, or post a simple message to either mailing list ...

You'll see the difference ...

( Heh, and if you want an even stronger contrast, try asking simple
questions in a lisp irc channel ... I've never had soo many people say "We
aren't going to help you with your homework" ... ( I'm 30+ and have been a
pro dev for about 10 of that ... sorry, it's *NOT* homework ). )

Anyways, really it all comes down to community, and I believe there is NO
other programming language with a community that is so nice to people and/or
easy to get along with ( even when there is strong disagreement ).


j.


On 12/22/05, Steve Litt <[hidden email]> wrote:

>
> On Thursday 22 December 2005 11:07 am, Gene Tani wrote:
> > Tolga wrote:
> > > First of all and very first of all, I must state that I am not
> > > an enemy or a spy :-D
> >
> > I don't have much to add, you can google for 750 k hits for "ruby
> > vs python" and read what people have written on c2.com and
> > artima.com "your interpreter/VM/lang spec/dev environment is
> > strap-on OO, pass by reference, weakly typed, weakly lexically
> > scoped, inconsistent API, writing C extensions sucks and it's
> > slow"
>
> If you read between the lines in this thread, you notice that only
> Python and Ruby are mentioned in positive light. Nobody stood up
> for Perl, or VB, or Pascal, or C++, or Java. Ruby and Python have
> obviously done something right, well beyond the convenience and
> capabilities of other languages of our time.
>
> I've used Perl since 1997, and fell so in love with Perl that my
> wife hired a private investigator, but since I've found Ruby, Perl
> seems so, well, so 1997. For me, life's too short to use anything
> but Ruby or Python in typical small to moderately sized programs
> that aren't extremely computation heavy (simulation and the like).
>
> SteveT
>
>
> Steve Litt
> http://www.troubleshooters.com
> [hidden email]
>
>


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

Jeff Wood
Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Martin DeMello-2
In reply to this post by Vivek Krishna
Tolga <[hidden email]> wrote:
> One or two weeks ago, I tried Python and loved it. But I also hearing
> ineteresting things about Ruby nowadays. Which language should I use?
> Oh, yes, this question looks somewhat silly, this is a Ruby group and
> people will tend to give an automatic "Ruby" reply. But as far as I
> see, Ruby (and Python) has a intellectual community. So, I hope that I
> will get logical explanations rather than "holigan" cries.

Whenever I'm asked for a one-word answer to why I prefer Ruby to Python,
that one word is 'blocks'. If you've used lisp, you should appreciate
the power of full-fledged lexical closures, and ruby makes them
*really* convenient to use. Indeed, the standard library is built
to make heavy use of blocks, and the one free block per method
positively encourages their use. It's really hard to describe how nice a
feature this is until you've used it for yourself, but a couple of weeks
investigating ruby should show you what I mean.

martin

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

baalbek
In reply to this post by Vivek Krishna
Steve Litt wrote:

> On Wednesday 21 December 2005 01:22 pm, Steffen Mutter wrote:
>
>>Am Wed, 21 Dec 2005 08:54:12 -0800 schrieb Tolga:
>>
>>>One or two weeks ago, I tried Python and loved it.
>>
>>What exactly did make you feel happy?
>
>
> What makes me happy about Python is subordination by indentation.
> Remember my thread on end matching, and how complex the answers
> became (one responder suggested getting a Ruby parser to do the
> job). That all becomes moot via subordination by indentation.
>
> If I screw up the indentation, I get either a syntax error or  *very
> obvious* runtime error.
>
> SteveT
>
> Steve Litt
> http://www.troubleshooters.com
> [hidden email]
>
>

Sorry, but the indentation feature of Python (along with the mandatory
prefix self of every class method) is one of the worst design decisions
made by a language designer, and is what turned me away from Python to Ruby.

That said, if there weren't a Ruby, I would still be a Pythonista!

Baalbek

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Ryan Sobol

On Dec 22, 2005, at 9:07 PM, baalbek wrote:

> Steve Litt wrote:
>> On Wednesday 21 December 2005 01:22 pm, Steffen Mutter wrote:
>>> Am Wed, 21 Dec 2005 08:54:12 -0800 schrieb Tolga:
>>>
>>>> One or two weeks ago, I tried Python and loved it.
>>>
>>> What exactly did make you feel happy?
>> What makes me happy about Python is subordination by indentation.  
>> Remember my thread on end matching, and how complex the answers  
>> became (one responder suggested getting a Ruby parser to do the  
>> job). That all becomes moot via subordination by indentation.
>> If I screw up the indentation, I get either a syntax error or  
>> *very obvious* runtime error.
>> SteveT
>> Steve Litt
>> http://www.troubleshooters.com
>> [hidden email]
>
> Sorry, but the indentation feature of Python (along with the  
> mandatory prefix self of every class method) is one of the worst  
> design decisions made by a language designer, and is what turned me  
> away from Python to Ruby.
>
> That said, if there weren't a Ruby, I would still be a Pythonista!
>
> Baalbek
>

Excuse my newbi-ness, but isn't that "self rule" for class methods  
similar in Ruby?  E.g.

class A
        def self.a_class_method
                puts "A class method"
        end
# OR
        def A.another_class_method
                puts "Another class method"
        end
end

~ ryan ~

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Brian Mitchell
On 12/22/05, J. Ryan Sobol <[hidden email]> wrote:

> Excuse my newbi-ness, but isn't that "self rule" for class methods
> similar in Ruby?  E.g.
>
> class A
>         def self.a_class_method
>                 puts "A class method"
>         end
> # OR
>         def A.another_class_method
>                 puts "Another class method"
>         end
> end

OR

class A
  class << self
    def foo; end
  end
end

OR

class A
  class << A
    def foo; end
  end
end

All equivalent in function definition (though surrounding scope can
differ inside class << declarations). It is similar but remember that
self is the class not an instance of the class.

Brian.

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

David A. Black-2
Hi --

On Fri, 23 Dec 2005, Brian Mitchell wrote:

> On 12/22/05, J. Ryan Sobol <[hidden email]> wrote:
>> Excuse my newbi-ness, but isn't that "self rule" for class methods
>> similar in Ruby?  E.g.
>>
>> class A
>>         def self.a_class_method
>>                 puts "A class method"
>>         end
>> # OR
>>         def A.another_class_method
>>                 puts "Another class method"
>>         end
>> end
>
> OR
>
> class A
>  class << self
>    def foo; end
>  end
> end
>
> OR
>
> class A
>  class << A
>    def foo; end
>  end
> end

Also:

   class A
   end

and then:

   class << A
     def foo; end
   end

or

   def A.foo
   end


David

--
David A. Black
[hidden email]

"Ruby for Rails", from Manning Publications, coming April 2006!
http://www.manning.com/books/black

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Gene Tani

[hidden email] wrote:

> Hi --
>
> On Fri, 23 Dec 2005, Brian Mitchell wrote:
>
> > On 12/22/05, J. Ryan Sobol <[hidden email]> wrote:
> >> Excuse my newbi-ness, but isn't that "self rule" for class methods
> >> similar in Ruby?  E.g.
> >>
> >> class A
> >>         def self.a_class_method
> >>                 puts "A class method"
> >>         end
> >> # OR
> >>         def A.another_class_method
> >>                 puts "Another class method"
> >>         end
> >> end
> >
> > OR
> >
> > class A
> >  class << self
> >    def foo; end
> >  end
> > end
> >
> > OR
> >
> > class A
> >  class << A
> >    def foo; end
> >  end
> > end
>
> Also:
>
>    class A
>    end
>
> and then:
>
>    class << A
>      def foo; end
>    end
>
> or
>
>    def A.foo
>    end
>

let's not forget

def ClassName::clsmeth(params)
end

(either inside or outside class def, so that's 5 ways to do it inside
class def, 3 outside for those keeping score at home, mostly python
hyperenthusiasts


Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

David A. Black-2
Hi --

On Fri, 23 Dec 2005, Gene Tani wrote:

> let's not forget
>
> def ClassName::clsmeth(params)
> end

Oh, let's :-)  I really wish :: as a synonym for the dot would
disappear.  I've never understood what purpose is served by it.


David

--
David A. Black
[hidden email]

"Ruby for Rails", from Manning Publications, coming April 2006!
http://www.manning.com/books/black

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Gene Tani

[hidden email] wrote:

> Oh, let's :-)  I really wish :: as a synonym for the dot would
> disappear.  I've never understood what purpose is served by it.
>
>

if "::" is used exclusively for class constants, i guess it's slightly
useful, otherwise i tend to agree


Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Jeff Wood
In reply to this post by Ryan Sobol
Actually, no.

The 'self' in ruby is a keyword, hardcoded and built into the language. (
Other languages use the same, java comes to mind ).

The 'self' in python is a self-inflicted community standard. They could have
saved countless keystrokes around the world and just used 's', 'me', or 'my'
... but nope ...

j.

On 12/22/05, J. Ryan Sobol <[hidden email]> wrote:

>
>
> On Dec 22, 2005, at 9:07 PM, baalbek wrote:
>
> > Steve Litt wrote:
> >> On Wednesday 21 December 2005 01:22 pm, Steffen Mutter wrote:
> >>> Am Wed, 21 Dec 2005 08:54:12 -0800 schrieb Tolga:
> >>>
> >>>> One or two weeks ago, I tried Python and loved it.
> >>>
> >>> What exactly did make you feel happy?
> >> What makes me happy about Python is subordination by indentation.
> >> Remember my thread on end matching, and how complex the answers
> >> became (one responder suggested getting a Ruby parser to do the
> >> job). That all becomes moot via subordination by indentation.
> >> If I screw up the indentation, I get either a syntax error or
> >> *very obvious* runtime error.
> >> SteveT
> >> Steve Litt
> >> http://www.troubleshooters.com
> >> [hidden email]
> >
> > Sorry, but the indentation feature of Python (along with the
> > mandatory prefix self of every class method) is one of the worst
> > design decisions made by a language designer, and is what turned me
> > away from Python to Ruby.
> >
> > That said, if there weren't a Ruby, I would still be a Pythonista!
> >
> > Baalbek
> >
>
> Excuse my newbi-ness, but isn't that "self rule" for class methods
> similar in Ruby?  E.g.
>
> class A
>         def self.a_class_method
>                 puts "A class method"
>         end
> # OR
>         def A.another_class_method
>                 puts "Another class method"
>         end
> end
>
> ~ ryan ~
>
>


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

Jeff Wood
Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Christian Neukirchen
In reply to this post by Jeff Wood
Jeff Wood <[hidden email]> writes:

> Actually, the one comparison that gets touched on a bit too lightly ... is
> the community...

> ( Heh, and if you want an even stronger contrast, try asking simple
> questions in a lisp irc channel ... I've never had soo many people say "We
> aren't going to help you with your homework" ... ( I'm 30+ and have been a
> pro dev for about 10 of that ... sorry, it's *NOT* homework ). )

I'd be really curious about what you asked there. :-)

> Anyways, really it all comes down to community, and I believe there is NO
> other programming language with a community that is so nice to people and/or
> easy to get along with ( even when there is strong disagreement ).

> Jeff Wood
--
Christian Neukirchen  <[hidden email]>  http://chneukirchen.org

Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

gregarican
In reply to this post by Jeff Wood
Jeff Wood wrote:

> Anyways, really it all comes down to community, and I believe there is NO
> other programming language with a community that is so nice to people and/or
> easy to get along with ( even when there is strong disagreement ).

I agree. After communicating in various communities I have found Ruby
by far to be the most receptive, patient, friendly, etc. This is after
communicating with Perl, C++, Java, VB, and other folks. From newbies
to experienced gurus, everyone for the most part is welcomed in the
world of Ruby. Let's hope as the language continues to gain exposure
and adoption this trend continues. It's difficult to imagine as the
community expands, but let's hope!


Reply | Threaded
Open this post in threaded view
|

Re: Why not Python? (No, no, I am not a spy)

Jeff Wood
In reply to this post by Christian Neukirchen
... I believe the question was in regards to implementing factorial in a
tail-recursive manner.

I believe the statement was:

"I'm a complete newb to lisp, I've been reading Practical Common Lisp & On
Lisp.  I've also been working through "The little schemer" and SICP... I'm
running CMUCL under SLIME & Emacs (v21.4). ( phew ) ... I've written an
iterative & a normally recursive version of factorial ... Now I'm trying to
figure out how to implement it in a tail-recursive fashion ... can anybody
help me write a tail-recursive version ?? I'm not familiar with the call
pattern yet." ...

or something like that ...

j.

On 12/23/05, Christian Neukirchen <[hidden email]> wrote:

>
> Jeff Wood <[hidden email]> writes:
>
> > Actually, the one comparison that gets touched on a bit too lightly ...
> is
> > the community...
>
> > ( Heh, and if you want an even stronger contrast, try asking simple
> > questions in a lisp irc channel ... I've never had soo many people say
> "We
> > aren't going to help you with your homework" ... ( I'm 30+ and have been
> a
> > pro dev for about 10 of that ... sorry, it's *NOT* homework ). )
>
> I'd be really curious about what you asked there. :-)
>
> > Anyways, really it all comes down to community, and I believe there is
> NO
> > other programming language with a community that is so nice to people
> and/or
> > easy to get along with ( even when there is strong disagreement ).
>
> > Jeff Wood
> --
> Christian Neukirchen  <[hidden email]>  http://chneukirchen.org
>
>


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

Jeff Wood
12