[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Tolga

12/21/2005 4:54:00 PM

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

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.

42 Answers

pat eyler

12/21/2005 5:08:00 PM

0

On 12/21/05, Tolga <tolgacavdar@gmail.com> wrote:
> First of all and very first of all, I must state that I am not an enemy
> or a spy :-D
>
> 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.

> 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

Not even a requirement.

> 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?

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.

>
> Waiting your replies.
> Thank you very much in advance.
>
>
>


--
thanks,
-pate
-------------------------


Jeff Wood

12/21/2005 5:13:00 PM

0

On 12/21/05, Tolga <tolgacavdar@gmail.com> wrote:
>
> First of all and very first of all, I must state that I am not an enemy
> or a spy :-D
>
> 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.



#2

Visit http://sciruby.codeforpeople.com/sr.cgi... 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...

Jeff Wood

Austin Ziegler

12/21/2005 5:16:00 PM

0

On 21/12/05, Tolga <tolgacavdar@gmail.com> wrote:
> First of all and very first of all, I must state that I am not an
> enemy or a spy :-D
>
> 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".

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

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.

> 6. 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
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca


james_b

12/21/2005 5:18:00 PM

0

Tolga wrote:
> First of all and very first of all, I must state that I am not an enemy
> or a spy :-D
>
> 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.ru.../RubyEyeForThePyth...
and
http://ruby-doc.or...

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

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

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

> 6. 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.ru... - Ruby Help & Documentation
http://www.artima.c... - Ruby Code & Style: Writers wanted
http://www.rub... - The Ruby Store for Ruby Stuff
http://www.jame... - Playing with Better Toys
http://www.30seco... - Building Better Tools


Steffen Mutter

12/21/2005 6:21:00 PM

0

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

Oliver Andrich

12/21/2005 6:23:00 PM

0

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. :) 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.

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

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

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

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

> 6. 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? :) 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. :)

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. :)

rcoder@gmail.com

12/21/2005 6:58:00 PM

0

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://r...

ptkwt

12/21/2005 7:10:00 PM

0

In article <1135184052.341721.42670@g49g2000cwa.googlegroups.com>,
Tolga <tolgacavdar@gmail.com> wrote:
>First of all and very first of all, I must state that I am not an enemy
>or a spy :-D
>
>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.

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

>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

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.

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

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

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

Logan Capaldo

12/21/2005 7:54:00 PM

0


On Dec 21, 2005, at 12:15 PM, Austin Ziegler 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?

Steve Litt

12/21/2005 8:01:00 PM

0

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.troublesh...
slitt@troubleshooters.com