PDA

View Full Version : Starting programming: Ruby or Python?



Enthralled
May 24th, 2008, 06:31 PM
Hello everyone!

I want to start programming, and I'm considering Python or Ruby (and later I hope that I'll pass onto C/C++, Java or maybe even some functional programming language), but I don't know which one of them should I choose. So I'd really like to hear your opinions about it. :grin:

P.S. I already know some of the programming basics.

Bichromat
May 24th, 2008, 06:41 PM
Both have their advantages and inconvenients. Here's a partial comparison :
http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-python/

Python has a more complete library and is faster.

Majorix
May 24th, 2008, 06:44 PM
There was a similar thread discussing Rb and Py, but whatever.

If you ask me, picking one of them is like between green and red apples. Very similar, but someone likes red, some do green. Technically though, both are apples, so you can eat whichever you like. Who would know if you like green apples or red ones? Only you can, after eating one of each, seeing the differences.

Hope I awakened the philosopher in you :lolflag:

natez0r
May 24th, 2008, 06:48 PM
There was a similar thread discussing Rb and Py, but whatever.

If you ask me, picking one of them is like between green and red apples. Very similar, but someone likes red, some do green. Technically though, both are apples, so you can eat whichever you like. Who would know if you like green apples or red ones? Only you can, after eating one of each, seeing the differences.

Hope I awakened the philosopher in you :lolflag:

well said. I agree though, both are similar and are a pretty good place to begin.

Enthralled
May 24th, 2008, 07:44 PM
There was a similar thread discussing Rb and Py, but whatever.

If you ask me, picking one of them is like between green and red apples. Very similar, but someone likes red, some do green. Technically though, both are apples, so you can eat whichever you like. Who would know if you like green apples or red ones? Only you can, after eating one of each, seeing the differences.

OK, but can you tell me which are the advantages of being green/red??? Or which apple do you people presonally like more, and why?


Hope I awakened the philosopher in you :lolflag:

You certainly did!:lol:

danbuter
May 24th, 2008, 09:25 PM
I think Python is good to learn as your first language, as it will teach many good habits regarding indents, readability, etc. The main adavantage you will get with Ruby is that you will really understand object-oriented programming from the get-go, much better than Python.

LaRoza
May 24th, 2008, 09:30 PM
Hello everyone!

I want to start programming, and I'm considering Python or Ruby (and later I hope that I'll pass onto C/C++, Java or maybe even some functional programming language), but I don't know which one of them should I choose. So I'd really like to hear your opinions about it. :grin:

P.S. I already know some of the programming basics.

See my home page and the language selector and my wiki. See wikipedia. See http://c2.com/cgi/wiki?PythonVsRuby

Only you can make the decision, and this decision isn't that big.

LaRoza
May 24th, 2008, 09:31 PM
I think Python is good to learn as your first language, as it will teach many good habits regarding indents, readability, etc. The main adavantage you will get with Ruby is that you will really understand object-oriented programming from the get-go, much better than Python.

Not really. The details of OO are not what beginners notice or even care about. Ruby and Python are not that different in their approach.

pmasiar
May 24th, 2008, 09:34 PM
See sticky FAQ: "Why I love/hate" entries for Ruby and Python.

Both languages are almost equivalent by itself, and are targeting the same niche. So it is hard to distinguish by language features alone. But if you take into consideration other factors, and consider how the competition between these languages will form over next 5-10 years, choice might be more obvious.

Python is little older, has bigger library and bigger community. Ruby is younger ("hotter" for language junkies) and is more pure OO - but Python has generic functions where Ruby has object methods for length etc.

Python development community is in USA and Europe, Ruby's main devel list is in Japanese.

Python is selected as one of main programming languages in Google, is used in NASA, ubuntu uses it as main language too. Ruby AFAIK does not have this 'approval'. There is SciPy conference about using Python is science computing, separate from PyCon, more oriented on language itself.

Python was designed to be used also by scientists who need to program, but are not CompSci experts: focus on readability, code outline defines structure, etc. Ruby is more modern sanctuary for old Perl hackers, who enjoy code so succinct it might be cryptic for less than expert hackers. This is feature for Ruby lovers, but a bug for Pythonistas.

Google App Engine (free web app hosting and more) works with Python only for now, and Ruby is not between Google's own preferred languages.

Ruby gained a lot of popularity 5 years ago with excellent web app framework, Rails, but since then many ideas were included to Python frameworks (Django, Turbogears) as well.

Summary (looking into my magic crystal ball :-) ): Ruby is fine language, but does not have enough to it to overcome early start advantage ans focus on readability of Python. Ruby will remain fine niche language, while Python will become mainstream, even enterprise-strong language.

Phenax
May 24th, 2008, 10:53 PM
Ruby is my choice.

The pure elegance of the object orientation is remarkable. I love the freedom to make my code as clean or as "succinct" as I want it to. Many large companies are adopting Ruby.. AMD, Google, and others have been visibly showing interest in using it.

I like how there are multiple ways to establish one end-point. Such is the ambiguity of spoken language, many different ways to say similar things; each with their own interpretation.

Python may be four years older and have more followers, but as many of us know being the most popular does not mean something is the best.

You should look into both languages and decide yourself. Both Ruby and Python are wonderful languages but have different philosophies and practices - the only person who can decide what is right for you is you.

Enthralled
May 24th, 2008, 10:55 PM
OK, thanks people (especially pmasiar), you helped my very much in my decision, so I'll start with Python :)

CptPicard
May 25th, 2008, 12:07 AM
Technically though, both are apples, so you can eat whichever you like. Who would know if you like green apples or red ones? Only you can, after eating one of each, seeing the differences.

Hope I awakened the philosopher in you :lolflag:

Taking philosophy one step further, from a utilitarian perspective one needs to consider the end result. Regardless of whether you eat a green or a red apple, it ends up looking all the same down the toilet, so it doesn't really matter which one you use.

So if the result is **** regardless, it doesn't matter and you should probably look elsewhere than apples. But as I actually like both Python and Ruby, I will not argue down this path :)

(And personally I would suggest Python)

EDIT: Considering you were willing to check out a functional language, I would seriously suggest you consider Clojure. It's a Lisp that runs on JVM, and I am growing quite fond of it... functional programming is not that difficult, it just requires a slightly different POV... and once you get it, it becomes very elegant indeed.

dark joev
May 25th, 2008, 02:07 AM
I would say python but I havent used Ruby. But from what I have heard they are both really good so give them both a try and see which one you like the most.

EdThaSlayer
June 1st, 2008, 03:04 PM
I think you should choose python...
Reason:
1. Shuttleworth programs in it
2. The one who started Ubuntu likes it
3. It comes with "batteries" included(all the libraries)

Sockerdrickan
June 1st, 2008, 03:29 PM
I think you should choose python...
Reason:
1. Shuttleworth programs in it
2. The one who started Ubuntu likes it
3. It comes with "batteries" included(all the libraries)
lol @ same person 1 and 2

GammaPoint
June 2nd, 2008, 05:55 PM
I've never actually used Ruby, but I first learned programming on Python and I love it. Since then I've also learned C++ and Fortran but Python remains my favorite language by far (but perhaps scripting languages are inherently more fun...).

So I don't know about Ruby, but I love Python and couldn't ask for anything more. I feel like I can do anything with it, and do it easily.

jespdj
June 3rd, 2008, 01:17 PM
I think you should choose python...
Reason:
1. Shuttleworth programs in it
2. The one who started Ubuntu likes it
3. It comes with "batteries" included(all the libraries)
All three of those (and 1 and 2 are really the same) are not very good reasons to choose a programming language.

Why would you choose a language just because some famous person likes it? And most serious programming languages come with an extensive library.

I like Ruby better than Python, because Ruby seems to be more clean and consistent to me than Python. But if I'd want to make a desktop application for Ubuntu, I'd choose Python, because many programs for Ubuntu are written in Python and because Python is installed by default on Ubuntu systems - if a program were written in Ruby, it would require the user to install Ruby on his/her system.

pmasiar
June 3rd, 2008, 02:44 PM
Why would you choose a language just because some famous person likes it? And most serious programming languages come with an extensive library.

It is not "famous person", some Britney Spears or Indiana Jones. Mark is experienced programmer with proven track record of accomplishments, debian developer, he knows how to make systems work (and make money on the way there). His endorsement values in my eyes invaluably more than endorsement from some random forum poster I know nothing about (sorry no offense but that's the fact). He knows what features are important, what works in real life. Only fool would value random anonymous forum poster endorsement as high as Mark's endorsement.

Also, even if serious languages have extensive libraries, Python's library is apparently more extensive than Ruby's, so that **IS** very valid argument when comparing those two languages against each other. Or do you argue that Ruby is NOT a serious language so does not need the library? :-)

Peyton
June 3rd, 2008, 06:21 PM
Just go with whatever one you think you'll feel more comfortable with. Later on, any concepts you've learned can easily be transferred to another language if the need arises.

baash05
March 7th, 2012, 06:18 AM
I'd suggest if you were moving over to c/c++ to go with Python.
It's structure is closer to what you'd find there and it's use of files is closer.
Rails assumes a lot for you and hides more than I'm comfortable with..

I liked the reasons for picking it that others stated.
And I too would take the advice of a famous person. If I wanted to learn how to make millions of $ singing, would I ask Britney.. You bet I would. If I wanted to make awesome software, would I talk to Linus or Joel.. In a heartbeat. Follow what those you admire are doing.. Step in their footsteps.


On a side.. go with c/c++.. Remember that the language you write code in will be the language you learn to think in. Google "how to learn c++ in ten short years". Ten years is a long time.. Start today :)