473,695 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python vs Ruby

Hi. I am interested in learning a new programming language, and have been
debating whether to learn Ruby or Python. How do these compare and contrast
with one another, and what advantages does one language provide over the
other? I would like to consider as many opinions as I can on this matter
before I start studying either language in depth. Any help/comments are
greatly appreciated. Thanks in advance for your help.
Oct 20 '05
65 5513
Bryan wrote:
Amol Vaidya wrote:
Hi. I am interested in learning a new programming language, and have
been debating whether to learn Ruby or Python.
(snip)
why don't you do what i did? download ruby and spend a day or two
reading "programmin g ruby" from www.ruby-lang.org/en. the download
python and spend a day or two reading the python tuturial from
www.python.org.


Or better: DiveIntoPython

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom. gro'.split('@')])"
Oct 20 '05 #11
Amol Vaidya wrote:
Hi. I am interested in learning a new programming language, and have been
debating whether to learn Ruby or Python. How do these compare and contrast
with one another, and what advantages does one language provide over the
other? I would like to consider as many opinions as I can on this matter
before I start studying either language in depth. Any help/comments are
greatly appreciated. Thanks in advance for your help.


The main point about "advantages " is that Python has a larger community,
a larger choice of libraries, and is somewhat more mature (which is not
surprising since Python is a little bit older than Ruby).

Else, both are hi-level highly dynamic object oriented languages, both
are fun to program with, and both are easy to get started with. So the
best thing to do is to give both a try and go with the one that fits
your brain.

--
bruno desthuilliers
ruby -e "print 'o****@xiludom. gro'.split('@') .collect{|p|
p.split('.').co llect{|w| w.reverse}.join ('.')}.join('@' )"
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom. gro'.split('@')])"
Oct 20 '05 #12
Depends on your experience. If you know C,C++,Java and the whole
C-syntax-bunch. I'd recommend Python just to learn to adapt a different
syntax. If you want to learn for the learnings sake, i'd also recommend
Haskell to try functional programming, if you do not already know it.

Ruby has some interesting concepts, Python (well CPython) does not
have. Blocks for example, which make Continuations possible. In Python
you need stackless Python (a different implementation) to do this.

Oct 20 '05 #13
In article <43************ ***********@new s.free.fr>,
bruno modulix <on***@xiludom. gro> wrote:
Bryan wrote:
Amol Vaidya wrote:
Hi. I am interested in learning a new programming language, and have
been debating whether to learn Ruby or Python.

(snip)

why don't you do what i did? download ruby and spend a day or two
reading "programmin g ruby" from www.ruby-lang.org/en. the download
python and spend a day or two reading the python tuturial from
www.python.org.


Or better: DiveIntoPython

Oct 20 '05 #15
What languages do you know already?

What computer science concepts do you know?

What computer programming concepts do you know?
Have you heard of Scheme?
Ruby is a bit Perl like -- so if you like Perl, chances are you might
like Ruby.

Python is more like Java.

I have heard, but have not been able to verify that if a program is
about
10,000 lines in C++
it is about
5,000 lines in Java
and it is about
3,000 lines in Python (Ruby to?)

Roy Smith <ro*@panix.co m> wrote:
In article <Zn************ ***@tornado.tex as.rr.com>,
"Amol Vaidya" <my*****@gmail. com> wrote:
Hi. I am interested in learning a new programming language, and have been
debating whether to learn Ruby or Python. How do these compare and contrast
with one another, and what advantages does one language provide over the
other? I would like to consider as many opinions as I can on this matter
before I start studying either language in depth. Any help/comments are
greatly appreciated. Thanks in advance for your help.


Of all the common scripting languages, Ruby has the highest vowel to
consonant ratio.

--
Regards,
Casey
Oct 20 '05 #16
Thank you for all the great information and links! I think I will do what a
lot of you reccomended and try both for myself, the only problem is finding
time with homework, college applications, and SATs coming up. I'll let you
know how it turns out. Again, thank you all for the help.
Oct 20 '05 #17

"Casey Hawthorne" <ca************ ***@istar.ca> wrote in message
news:02******** *************** *********@4ax.c om...
What languages do you know already?

What computer science concepts do you know?

What computer programming concepts do you know?
Have you heard of Scheme?
Ruby is a bit Perl like -- so if you like Perl, chances are you might
like Ruby.

Python is more like Java.

I have heard, but have not been able to verify that if a program is
about
10,000 lines in C++
it is about
5,000 lines in Java
and it is about
3,000 lines in Python (Ruby to?)


I've done a lot of studying on my own, and taken the classes that my
high-school offers. I feel that I have a fairly good understanding of Java,
and basic OO concepts due to that. I've created some semi-complex programs
in java, in my opinion, such as networked checkers, 8-player blackjack, a
space-shooter type game, a copy of mario (one level, anyway), and some other
stuff. I've also done a bit of studying on C. I've done a few projects in C,
including another space-shooter type of game using SDL, an IRC client and
some simple database-type programs. I also gave a shot at assembly using
NASM for x86 before, but didn't get too far. I wrote some trivial code --
wrote to the video buffer, played with some bios interrupts, stuff like
that. The only thing I did in assembly was create a program that loads at
boot-up, and loads another program that just reiterates whatever you type
in. I only did that because I was curious. That's about as far as my
programming knowledge/experience goes.

Well, I'm not sure what you mean by programming concepts. I'm familiar with
OO through Java, and procedural programming through C. I'd be more detailed,
but I'm not exactly sure what you are asking. Sorry.

I have no idea what Scheme is, but I'll cettainly look it up as soon as I'm
done writing this.

I've never given Perl a shot. It was another language I considered learning,
but my father's friend told me to go with Python or Ruby.

Thanks for your help. Hopefully I wasn't too lengthy in this post.
Oct 20 '05 #18
On Thu, 20 Oct 2005, Amol Vaidya wrote:
"Casey Hawthorne" <ca************ ***@istar.ca> wrote in message
news:02******** *************** *********@4ax.c om...
What languages do you know already? What computer science concepts do
you know? What computer programming concepts do you know? Have you
heard of Scheme?
Good questions!
Ruby is a bit Perl like -- so if you like Perl, chances are you might
like Ruby.
I don't think rubyists would appreciate that description. Ruby may be
heavier on the funky symbols than python, but it's a very clean, elegant,
usable, well-thought-out and deeply object-oriented language - in other
words, nothing at all like perl.
Python is more like Java.
Python is *nothing* like java.
I have heard, but have not been able to verify that if a program is
about
10,000 lines in C++
it is about
5,000 lines in Java
and it is about
3,000 lines in Python (Ruby to?)

ITYM 300. Yes, ruby too.
I've done a lot of studying on my own, and taken the classes that my
high-school offers. I feel that I have a fairly good understanding of
Java, and basic OO concepts due to that. I've created some semi-complex
programs in java, in my opinion, such as networked checkers, 8-player
blackjack, a space-shooter type game, a copy of mario (one level,
anyway), and some other stuff. I've also done a bit of studying on C.
I've done a few projects in C, including another space-shooter type of
game using SDL, an IRC client and some simple database-type programs. I
also gave a shot at assembly using NASM for x86 before, but didn't get
too far. I wrote some trivial code -- wrote to the video buffer, played
with some bios interrupts, stuff like that. The only thing I did in
assembly was create a program that loads at boot-up, and loads another
program that just reiterates whatever you type in. I only did that
because I was curious. That's about as far as my programming
knowledge/experience goes.
An excellent start!
Well, I'm not sure what you mean by programming concepts. I'm familiar
with OO through Java, and procedural programming through C. I'd be more
detailed, but I'm not exactly sure what you are asking. Sorry.
I think i know what Casey means, but i don't know if i can explain it any
better. Do you understand the concept orthogonality? The Once And Only
Once principle? Have you ever heard of design patterns?
I have no idea what Scheme is, but I'll cettainly look it up as soon as
I'm done writing this.
You won't like it. Give yourself another 5-10 years, and you might start
to find it strangely intriguing.
I've never given Perl a shot. It was another language I considered
learning, but my father's friend told me to go with Python or Ruby.
Your father has good friends.
Thanks for your help. Hopefully I wasn't too lengthy in this post.


Lengthy is fine!

Anyway, the upshot of all this is that, yes, you should learn python.
Python is dope!

tom

--
NOW ALL ASS-KICKING UNTIL THE END
Oct 20 '05 #19
I don't think you really need to give to much time in weighting between
python or Ruby. Both are fine. But Python has the obvious advantage
that it has much more modules than Ruby so many things you don't need
to implement if you have real work to do.

I recommend you give haskell a shot if you are "in" to programming
because it makes you think differently, not necessary better(at least
not all the time) but helps.

I am not sure your intention but I think there isn't a one language
fits all situation here. I frequently use the following:

C/C++ - for linux kernel hacking etc., many library out there still use
it
python - generic stuff
SQL - nothing beats it for many business apps
haskell - a language to train my brain
javascript - Web front end

other than haskell and SQL, the others are more or less the same to me
so getting familiar with them is not too difficult.

Amol Vaidya wrote:
I've done a lot of studying on my own, and taken the classes that my
high-school offers. I feel that I have a fairly good understanding of Java,
and basic OO concepts due to that. I've created some semi-complex programs
in java, in my opinion, such as networked checkers, 8-player blackjack, a
space-shooter type game, a copy of mario (one level, anyway), and some other
stuff. I've also done a bit of studying on C. I've done a few projects in C,
including another space-shooter type of game using SDL, an IRC client and
some simple database-type programs. I also gave a shot at assembly using
NASM for x86 before, but didn't get too far. I wrote some trivial code --
wrote to the video buffer, played with some bios interrupts, stuff like
that. The only thing I did in assembly was create a program that loads at
boot-up, and loads another program that just reiterates whatever you type
in. I only did that because I was curious. That's about as far as my
programming knowledge/experience goes.

Well, I'm not sure what you mean by programming concepts. I'm familiar with
OO through Java, and procedural programming through C. I'd be more detailed,
but I'm not exactly sure what you are asking. Sorry.

I have no idea what Scheme is, but I'll cettainly look it up as soon as I'm
done writing this.

I've never given Perl a shot. It was another language I considered learning,
but my father's friend told me to go with Python or Ruby.

Thanks for your help. Hopefully I wasn't too lengthy in this post.


Oct 21 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2360
by: Adam | last post by:
Hi I had Ruby 1.6.8-8 for Windows installed on my WinXP Pro machine prior to installing Python 2.3. After installing Python 2.3, I tried to <----- screen output of python interactive command line -----> Python 2.3 (#46, Jul 29 2003, 18:54:32) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from Tkinter import * >>> root = Tk()
220
19032
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it seems that Ruby has the potential to compete with and displace Python. I'm curious on what basis it...
54
6550
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO FRICKIN' COOL!!! ***MAN*** that would save me a buttload of work and make my life sooooo much easier!" As opposed to minor differences of this feature here, that feature there. Variations on style are of no interest to me. I'm coming at this from a...
467
21495
by: mike420 | last post by:
THE GOOD: 1. pickle 2. simplicity and uniformity 3. big library (bigger would be even better) THE BAD:
13
2705
by: Wayne Folta | last post by:
I've been a long-time Perl programmer, though I've not used a boatload of packages nor much of the tacky OO. A couple of years ago, I decided to look into Python and Ruby. Python looked OK, but not that different. I did like the indent-as-group idea, which was different. Ruby looked very cool. But it was impossible to get good documentation. It seemed like a Japanese cult with a few western initiates. Well, MacOS X ships with Perl,...
30
3453
by: Christian Seberino | last post by:
How does Ruby compare to Python?? How good is DESIGN of Ruby compared to Python? Python's design is godly. I'm wondering if Ruby's is godly too. I've heard it has solid OOP design but then I've also heard there are lots of weird ways to do some things kinda like Perl which is bad for me. Any other ideas?
22
2705
by: Francois | last post by:
I discovered Python a few months ago and soon decided to invest time in learning it well. While surfing the net for Python, I also saw the hype over Ruby and tried to find out more about it, before I definitely embarked on studying and practicing Python. I recently found two sufficient answers for choosing Python - which is a personal choice and others may differ, but I'd like to share it anyway : 1) In Ruby there is a risk of...
52
3599
by: Steve Holden | last post by:
I've been thinking (and blogging) about python evangelism since PyCon, as a result of which I created a squidoo lens: http://www.squidoo.com/pythonlogy Imagine my surprise at discovering that this has gone up in rank (by number of views) from # 442,000 or so to #153! Clearly there's some mileage in marketing Python, and I'd like to keep the buzz going if it means more people will adopt the language.
0
1398
by: bruce | last post by:
hey guys... i managed to solve what i was attempting.. my goal was rather simple, to be able to have a python script, call a ruby app, and be able to return a value from the ruby (child) app to the parent.. blocking/unblocking wasn't on my radar for now. ultimately, my goal is to have an app on a master server, with that app calling the ruby app using the remote functions (rsh/rexec for now).
0
8553
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9112
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8819
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6482
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4332
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2994
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.