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 <slitt@earthlink.net> 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
>
> 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).
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.
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!
OK then. I will. C++ is fantastic. Most likely for jobs you would not or could not use Ruby for. The products I work on require C++/C and assembler. You couldn't possibly write them in Ruby. Even if you could they would be too slow.
When I'm not using C++, Ruby is what I am using, or intending to use.
Java - I always felt like I was writing code whilst wearing a straight jacket. In 9 years of using Java (I started in May 1996) I didn't like it - but you use what you are asked to use by the customer.
Merry Christmas
Stephen
···
In message <200512221332.19583.slitt@earthlink.net>, Steve Litt <slitt@earthlink.net> writes
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.
--
Stephen Kellett
Object Media Limited http://www.objmedia.demon.co.uk/software.html
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
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 ~
···
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
slitt@troubleshooters.com
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!
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 ).
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!
Three years ago I wanted to put all of the medical records of my office into a Zaurus pda. However, the Zaurus
used python with QT as a GUI. The office system is on Windows 2000. So, I had to learn python to program the
Zaurus but I could use Ruby on the office computers because those programs were command line and did not depend
on a GUI. It took me half the time for the Ruby programs compared to programming the python component. So I much
prefer ruby.
On another note, having used Fox, QT, and Tk as GUI's I found that QT is by far the best documented and flexible GUI.
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.
···
On 12/22/05, J. Ryan Sobol <ryansobol@gmail.com> 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
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 <ryansobol@gmail.com> 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
>> slitt@troubleshooters.com
>
> 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
... 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 <chneukirchen@gmail.com> wrote:
Jeff Wood <jeff.darklight@gmail.com> 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 ).
As long as we haven't already gathered up all of the nice people, I don't
see us having any problems ...
j.
···
On 12/23/05, gregarican <greg.kujawa@gmail.com> wrote:
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!
... 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." ...
>> 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
···
On Fri, 23 Dec 2005, Brian Mitchell wrote:
> On 12/22/05, J. Ryan Sobol <ryansobol@gmail.com> wrote:
ah, but to me that isn't completely iterative.... iterative is using a loop
within a function to make sure it and all functions it calls do not call
back up the tree...
hence:
# yes assumptions about positive integer numbers...
# complete recursive:
def factorial( x )
return 0 if x < 1
x * factorial( x - 1 )
end
# tail-recursive:
def factorial( x, sum = 1 )
return 0 if x < 1
factorial( ( x - 1 ), ( sum * x ) )
end
# iterative:
def factorial( x )
sum = 1
for i in (1..x).to_a
sum *= i
end
end
... anyways.
j.
···
On 12/23/05, Christian Neukirchen <chneukirchen@gmail.com> wrote:
Jeff Wood <jeff.darklight@gmail.com> writes:
> ... 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." ...
# yes assumptions about positive integer numbers...
# factorial of 0 is undefined ...
# complete recursive:
def factorial( x )
return 1 if x < 1
x * factorial( x - 1 )
end
# tail-recursive:
def factorial( x, sum = 1 )
return 1 if x < 1
factorial( ( x - 1 ), ( sum * x ) )
end
# iterative:
def factorial( x )
sum = 1
for i in (1..x).to_a
sum *= i
end
end
···
On 12/23/05, Jeff Wood <jeff.darklight@gmail.com> wrote:
ah, but to me that isn't completely iterative.... iterative is using a
loop within a function to make sure it and all functions it calls do not
call back up the tree...
hence:
# yes assumptions about positive integer numbers...
# complete recursive:
def factorial( x )
return 0 if x < 1
x * factorial( x - 1 )
end
# tail-recursive:
def factorial( x, sum = 1 )
return 0 if x < 1
factorial( ( x - 1 ), ( sum * x ) )
end
# iterative:
def factorial( x )
sum = 1
for i in (1..x).to_a
sum *= i
end
end
... anyways.
j.
On 12/23/05, Christian Neukirchen <chneukirchen@gmail.com> wrote:
>
> Jeff Wood <jeff.darklight@gmail.com> writes:
>
> > ... 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." ...
>
> I see, the iterative version at
> http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-21.html#%_thm_3.9<http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-21.html#%25_thm_3.9>
> actually is the tail-recursive version.
>
> They could have told you that, of course.
>
> > or something like that ...
> >
> > Jeff Wood
> --
> Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
>
>
ah, but to me that isn't completely iterative.... iterative is using a loop
within a function to make sure it and all functions it calls do not call
back up the tree...
There are no loops in Scheme. (while is syntactic sugar.)