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

First of all and very first of all, I must state that I am not an enemy
or a spy :smiley:

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.

By the way, I am not a computer scientist and these are the reasons why
I want to learn Python or Ruby. Please consider them when replying:

  1. I am not a computer scientist.
  2. I AM interested in artificial intelligence and this is the major
    reason for me to learn a programming language.
  3. I am familiar, but not experienced, in BASIC, C/C++, Java, Prolog
    and Lisp.
  4. I am NOT interested in web programming at all
  5. Nice GUIs always attract me. It is not mandatory but if Ruby can
    provide me this (better than Python) I may immediately run to Ruby.
  6. And finally, what is “Rails”? Do I have to learn it if I dive into
    Ruby? Does it necessary for only web?

Waiting your replies.
Thank you very much in advance.

On 12/21/05, Tolga [email protected] wrote:

  1. And finally, what is “Rails”? Do I have to learn it if I dive into
    Ruby? Does it necessary for only web?

Waiting your replies.
Thank you very much in advance.

#2

Visit http://sciruby.codeforpeople.com/sr.cgi/FrontPage for more
information
about people using Ruby for scientific projects.

#5

As with all programming languages there are bindings for Ruby for all of
the
major GUI frameworks.

These days, I would say the most beautifully ruby one is QTruby. I
don’t
know of too many online resources for the project, but there was a PDF
published by the pragmatic programmers on the topic.

#6

Rails is simply a web framework. Since you’ve already stated you aren’t
interested in Web apps, don’t worry about it right now.

Hope that helps.

j.

–
“Remember. Understand. Believe. Yield! → http://ruby-lang.org”

Jeff W.

On 12/21/05, Tolga [email protected] wrote:

First of all and very first of all, I must state that I am not an enemy
or a spy :smiley:

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.

Well, there has already been a lot of discussion around this. To me it
comes down to some unscientific bits. Everytime I’ve picked up python,
it’s made my head hurt. It doesn’t seem to match the way I think.

I’m not a super hacker, with experience in a whole bunch of languages,
but Ruby has made me a better programmer. Even as a lightweight, I’ve
been able to put together some cool tools, pick up some good habits,
and even teach other people a bit. The way that Ruby fits my thinking
and hacking patterns has a lot to do with my success.

By the way, I am not a computer scientist and these are the reasons why
I want to learn Python or Ruby. Please consider them when replying:

  1. I am not a computer scientist.

Not really a problem, but I think you’ll find that with Ruby you start
doing
things that make you look like a computer scientist … it just comes
naturally.

  1. I AM interested in artificial intelligence and this is the major
    reason for me to learn a programming language.
  2. I am familiar, but not experienced, in BASIC, C/C++, Java, Prolog
    and Lisp.
  3. I am NOT interested in web programming at all

Not even a requirement.

  1. Nice GUIs always attract me. It is not mandatory but if Ruby can
    provide me this (better than Python) I may immediately run to Ruby.
  2. And finally, what is “Rails”? Do I have to learn it if I dive into
    Ruby? Does it necessary for only web?

Rails is a web programming framework. A lot of people like it, some
people
(even Ruby folk) don’t. You don’t need to go anywhere near it if you
don’t
want to.

Tolga wrote:

First of all and very first of all, I must state that I am not an enemy
or a spy :smiley:

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.

Pick the language that makes you happy, that best fits your brain while
enabling to write good code. It may be Ruby, it may be Python. It may
be VB.net. Hard to say; you likely will need to give various candidates
a serious test drive to make your choice.

Ruby and Python have much in common; I’ve found that Ruby suits me
better. It makes fewer demands on me.

But take a look at

http://www.ruby-doc.org/RubyEyeForThePythonGuy.html
and

By the way, I am not a computer scientist and these are the reasons why
I want to learn Python or Ruby. Please consider them when replying:

  1. I am not a computer scientist.
  2. I AM interested in artificial intelligence and this is the major
    reason for me to learn a programming language.
  3. I am familiar, but not experienced, in BASIC, C/C++, Java, Prolog
    and Lisp.

Lisp may have more AI stuff for it. It’s also a nice language.

  1. I am NOT interested in web programming at all
  2. Nice GUIs always attract me. It is not mandatory but if Ruby can
    provide me this (better than Python) I may immediately run to Ruby.

Ruby offers GUIs. I don’t know if it does better than Python.

  1. And finally, what is “Rails”? Do I have to learn it if I dive into
    Ruby? Does it necessary for only web?

Rails is a Web app framework. Strictly optional, and probably not of
interest unless you want to make web sites.

James

http://www.ruby-doc.org - Ruby Help & Documentation
Ruby Code & Style - Ruby Code & Style: Writers wanted
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
http://www.30secondrule.com - Building Better Tools

On 21/12/05, Tolga [email protected] wrote:

First of all and very first of all, I must state that I am not an
enemy or a spy :smiley:

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?

Whichever one makes you happier.

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.

By the way, I am not a computer scientist and these are the reasons
why I want to learn Python or Ruby. Please consider them when
replying:

  1. I am not a computer scientist.
  2. I AM interested in artificial intelligence and this is the major
    reason for me to learn a programming language.
  3. I am familiar, but not experienced, in BASIC, C/C++, Java, Prolog
    and Lisp.

There are some people who prefer list comprehensions in Python, but find
it less useful as a “functional” language overall. However, functions in
Python are just that: functions. They are assignable and must be called
with parenthesis:

def foo:
…

bar = foo # assigns the foo function to bar
bar() # calls the foo function

Ruby is fully OO, but is considered by some to have more “functional”
features, but there are no functions (as such) in Ruby. they are all
methods and they are not directly assignable.

def foo
…
end

bar = foo # calls the foo method and assigns the result to bar
bar = method(:foo) # assigns the method foo to bar
bar[] # calls the foo method
bar.call # calls the foo method

There are other ways, but that’s a distinct difference. Ruby, however,
has blocks with closures and supports lambdas and currying very easily.
This should be easily discovered; Mental is currently writing a series
on doing Monads with Ruby and there’s a lot of people doing what is
perhaps best called “higher order Ruby” or “functional Ruby”.

  1. I am NOT interested in web programming at all
  2. Nice GUIs always attract me. It is not mandatory but if Ruby can
    provide me this (better than Python) I may immediately run to Ruby.

Python probably has the advantage with wxPython; I have seen little
movement in wxRuby lately, but Ruby does have strong support for Tk, the
FOX toolkit (through FXRuby), GTK, QT (there’s even a PDF book published
about that). It also has Cocoa support for the Mac and native Win32 MFC
support on Windows through VisualuRuby and SWin.

  1. And finally, what is “Rails”? Do I have to learn it if I dive into
    Ruby? Does it necessary for only web?

No, you don’t need to learn it. You need to learn Ruby if you want to
really do Rails. Rails is an end-to-end web application stack that
provides web-to-database CRUD application support very inexpensively. It
also supports some level of email handling and other things, but it’s
divided into subprojects such that Rails itself is mostly just a
collection of scripts that uses the subprojects to lay out applications
in a very opinionated way.

-austin

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?

But I also hearing
ineteresting things about Ruby nowadays. Which language should I use?

Take the language which makes your brain happy and offers you the
opportunity to develop the applications you think the world was waiting
for in a minute.
The documentation of Python’s is better (IMHO) so far,if you’d like to
spend a lot of money in books or googkle a dive into python.
If you’d like to go wild in a second I suggest you get the new
pragmatic programmer’s ‘programming ruby book’ v2.

Oh, yes, this question looks somewhat silly, this is a Ruby group and
people will tend to give an automatic “Ruby” reply.

Not really. If you like python, stay for a while with it and
get experienced.
Maybe you should choose a commercial IDE like I did with ‘komodo’ and I
enjoy hacking with it very much, so you still have the opportunity to
develop in different programming languages.

By the way, I am not a computer scientist and these are the reasons
why
I want to learn Python or Ruby.

You don’t need to be a computer scientist to write useful programs or
get
geeky.
Just think about what you really want to code.
If you want to code applications which really need to be object
orientated
you won’t miss the easy coding experience offered by ruby.

Regards,
Steffen

Tolga,

I’m going to risk several demerits here, and recommend that you look at
Python first, and Ruby second, for the following reasons:

  1. Python was initially funded, designed, and documented in large part
    as a “teaching” language. The syntax is extremely consistent, as are
    the core libraries.

  2. The free, online documentation for Python is absolutely without
    peer. Working just from the main tutorial and langauge reference on the
    main Python website, you should have no trouble getting up to speed on
    the language.

  3. Python still has a more substantial presence in both CS and the
    natural sciences, which means more (and somewhat higher-quality)
    libraries and books covering the techniques and tools you will need for
    AI work. Peter Norvig, very highly-respected AI researcher and
    instructor, has even translated his code from “AI: A Modern Approach”
    from Lisp to Python.

  4. In my experience, the GUI libraries for Python are simply more
    mature, better documented, (there’s that word again!) and more widely
    used that the equivalents for Ruby. If you want rich client interfaces,
    using Python will make your life easier.

That being said, the languages are really more alike in capabilities
than different. Also, even with the recent rise of Rails into
popularity, it has been my experience that the Ruby community is
absolutely wonderful to work with; it is seldom you will see a question
be ignored or the asker scorned, even in high-volume channels like this
newsgroup.

Regardless of which language you choose, I wish you the best of luck.

-Lennon
http://rcoder.net/

Hi!

Tolga schrieb:

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.

Well, I have been using Python a lot for a long time, and I guess I will
continue to use it in some areas. But recently I gave up my prefudices
about Ruby a view weeks ago. I resisted to use it, cause I thought with
Java and Python I was perfectly equipped for the tasks I have to deal
with. But I kept reading about the fun using ruby, the joy you
experience and the freedom.

Then I decided to redo a web app developed by a contractor of my
company. I looked into the avaiable stuff for my usual programming
languages, but was disappointed one way or another. So, I am mostly a
Ruby learner/new user who was intrigued by Rails. :slight_smile: But during the last
weeks I did less with Rails but with Ruby, cause I had a lot of fun with
it and some Java/Python tools I have been using, have been reimplemented
in Ruby for fun and to learn it.

  1. I am not a computer scientist.

Well, then Ruby and Python are good choices.

  1. I AM interested in artificial intelligence and this is the major
    reason for me to learn a programming language.
  2. I am familiar, but not experienced, in BASIC, C/C++, Java, Prolog
    and Lisp.

As I have been doing a lot computational linguistics and agent oriented
programming, I would say that you are already perfectly equipped for
this. :slight_smile:

  1. Nice GUIs always attract me. It is not mandatory but if Ruby can
    provide me this (better than Python) I may immediately run to Ruby.

Well, I would say, the toolkits you can access are almost the same for
both languages.

  1. And finally, what is “Rails”? Do I have to learn it if I dive into
    Ruby? Does it necessary for only web?

You said, you won’T do web programming, so rails is not of interest to
you. But ActiveRecord can be interesting as an ORM.

Didn’t give you much insight so far, did it? :slight_smile: Well, I might read
offensive, but in my eyes you haven’t asked the right questions, cause
both Python und Ruby will satisfy you based on your questions. My
decision to finally learn Ruby and enjoy using it, are based on only one
thing - the way to express myself and my ideas in the language. I have
been using and loving Python for its clarity in syntax, design and
general appeal. But a lot of this appeal depends on the “there is one
way to do something”-mentality. Once I loved this, cause it opened my
eyes after a long dark age using Perl and C. :slight_smile:

But it got me a little bit frustrated/bored during the last years to be
honest, and I have been always peeking at the Perl times with a lot of
fancy, compact and creative code. And after my first steps with Ruby I
discovered, that the clean appeal and clarity of Python can be combined
with a artful expression of thoughts in Ruby.

So, my sole point in this is, that Ruby and Python compare quite well.
Each offers some unique features, that the other implements in a
different way, but basically they are more or less equal. But I give you
one advice. Look into both. Spend a weekend with Python and learn it a
little. Do the same with Ruby. And at the end, compare them and choose
the one where you could express your ideas best with. And best means in
my eyes, the way the looks most natural to you. I won’t give you the
advice to use Python or to use Ruby, cause I can’t decide this for you,
cause I don’t know you enough for that.

Best regards,
Oliver

P.S.: Hopefully it is comprehensible what I mean. I am not an native
english speaker, so I have some difficulties to express such things in
english. :slight_smile:

On Dec 21, 2005, at 12:15 PM, Austin Z. wrote:

Rails itself is mostly just a
collection of scripts that uses the subprojects to lay out
applications
in a very opinionated way.

Brilliant! Mind if I quote you in sigs in such?

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 L.

[email protected]

In article [email protected],
Tolga [email protected] wrote:

By the way, I am not a computer scientist and these are the reasons why
I want to learn Python or Ruby. Please consider them when replying:

  1. I am not a computer scientist.
  2. I AM interested in artificial intelligence and this is the major
    reason for me to learn a programming language.

We have similar interests, I think. I’ve used Ruby for programming
various
machine learning algorithms from genetic algorithms, to support vector
machines.

You should check out the SciRuby site:
http://sciruby.codeforpeople.com/

  1. I am familiar, but not experienced, in BASIC, C/C++, Java, Prolog
    and Lisp.
  2. I am NOT interested in web programming at all

Same here. Or maybe I would say that I have just a little interest in
web
programming. Rails has put the emphasis on web programming, but Ruby
can be
used for much more than just web programming.

  1. Nice GUIs always attract me. It is not mandatory but if Ruby can
    provide me this (better than Python) I may immediately run to Ruby.

I don’t know about ‘better’, but probably at least as good.

  1. And finally, what is “Rails”? Do I have to learn it if I dive into
    Ruby? Does it necessary for only web?

No, you don’t have to learn Rails to learn Ruby (actually, it’s more the
other
way around). Rails is a web programming framework built on Ruby.

Since you tried Python last week, you should give Ruby a try this week.
That’ll give you a good idea of which language you find preferable.

Phil

On 21/12/05, Logan C. [email protected] wrote:

On Dec 21, 2005, at 12:15 PM, Austin Z. wrote:

Rails itself is mostly just a
collection of scripts that uses the subprojects to lay out
applications
in a very opinionated way.
Brilliant! Mind if I quote you in sigs in such?

Sure, I guess :wink:

I’m just taking some of DHH’s words and putting them in different
contexts, is all.

-austin

Thank you all for your replies. I think, I’ve learned how to find my
way ;-D
And I see that I was right when I stated “Python and Ruby have
intellectual communities”.

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.

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.

On 12/22/05, Vivek [email protected] 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.

Tolga wrote:

First of all and very first of all, I must state that I am not an enemy
or a spy :smiley:

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+"python+vs.+ruby"&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.

Gene T. 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

Yep, that is a great link.

And pretty darn’d accurate …

j.

On 12/22/05, Gene T. [email protected] wrote:

–
“Remember. Understand. Believe. Yield! → http://ruby-lang.org”

Jeff W.

On Thursday 22 December 2005 11:07 am, Gene T. wrote:

Tolga wrote:

First of all and very first of all, I must state that I am not
an enemy or a spy :smiley:

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 L.

[email protected]