Ruby or Python?

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
Which of these are more widely used and for more uses/applications? This is primarily for a website but to apply the knowledge somewhere else down the road. It seems from everything I've read so far, Python is more in use in the workplace and Ruby (or at least Rails) seems to have memory issues (?). That claim is unvalidated and appears it might be outdated but I've seen remarks made about systemic issues stemming from mark and sweep.
This isn't for me at the moment as I'm researching for a friend. Only open source languages/platforms are of interest, and Python/Ruby seem to be the top choices. PHP has been ruled out.
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
They both do a decent job for web applications, both have good modern web frameworks. Ruby's syntax is a little cleaner and more consistent, but Python is slightly more popular although its hard to tell.

Much of the modern web is written in Ruby, it runs just fine. They both have potentially problematic Garbage collectors, and if you search for Java garbage collection problems you'll find hundreds of those as well. Garbage collection in general is something you have to pay attention to once you get to any form of scale, but it is unlikely to be a problem initially.

Me personally I prefer Ruby and Rails to Python and Django as I prefer the syntax and the consistent semantics for Object behaviour.
 

WhoBeDaPlaya

Diamond Member
Sep 15, 2000
7,415
404
126
Nothing beats Ruby, Rails and Coco.
At work (EDA), I use Ruby and Coco all the time to implement DSLs. Still feels like magic to me even though I've done it so many times :)
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
Nothing beats Ruby, Rails and Coco.
At work (EDA), I use Ruby and Coco all the time to implement DSLs. Still feels like magic to me even though I've done it so many times :)

I came here to ask because I trust your opinions. I'm going to suggest Ruby for the projects moving forward. I might be assisting him with this project, even though I have no experience with either language or associated frameworks.
 

dwell

pics?
Oct 9, 1999
5,185
2
0
Python is more popular but Ruby is more hip and modern. I like Python for scripting and automation but it feels a little old and disjointed in places. I wrote a big-ish OSS project in Python and liked the library support. If I ever needed to do something there was a library for it. I have yet to dig deep into Ruby I like what I've used so far.
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
Based on my experience, Python is more used in the industry and is used in a broader range of fields. Ruby might be more popular in web applications, though.

Just as an example, Python has the Numpy and Scipy packages, which are used in scientific computing fields. Ruby doesn't have a real competitor to that at this point.
 

Danimal1209

Senior member
Nov 9, 2011
355
0
0
I took a class on Ruby recently and enjoyed it.

Ruby seems to be very simple to understand, and when you understand the way rails operates (and you get it installed properly), then you're good to go.

With the rails framework you can use it to generate a webpage similar to what you are looking for, and then modify the code to exactly how you want it.

I liked Ruby a lot.
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
Honestly you wont go wrong with either, they are both popular languages that have their own subtle strengths and weaknesses and both have excellent frameworks. You'll find strong open source communities in both, lots of libraries in both. These are far from esoteric toy languages, real people have built real things with both these languages and you use websites running on these every day (twitter, facebook, yahoo etc etc).

You could flip a coin and make a decent choice on this one.

But bare in mind since I don't know what you are writing I can't comment as to whether this is the right pair of languages to be choosing between. Just don't use them for scientific computation or HPC.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
I'm assuming those benchmarks are to show Ruby in a poor light. I've done more reading and it appears groupon.com is built entirely with RoR, which says enough. I'm under the impression that it's a matter of different tools for different goals.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
Honestly you wont go wrong with either, they are both popular languages that have their own subtle strengths and weaknesses and both have excellent frameworks. You'll find strong open source communities in both, lots of libraries in both. These are far from esoteric toy languages, real people have built real things with both these languages and you use websites running on these every day (twitter, facebook, yahoo etc etc).

You could flip a coin and make a decent choice on this one.

But bare in mind since I don't know what you are writing I can't comment as to whether this is the right pair of languages to be choosing between. Just don't use them for scientific computation or HPC.

That won't be the use, mainly standard webapps/pages. It's mostly to learn a modern language, specific, necessary use of it would be forthcoming. The other alternative was PHP but it seems Rails is more forward looking and PHP is great if you have a job using it or need to maintain older work.
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
Honestly you wont go wrong with either, they are both popular languages that have their own subtle strengths and weaknesses and both have excellent frameworks. You'll find strong open source communities in both, lots of libraries in both. These are far from esoteric toy languages, real people have built real things with both these languages and you use websites running on these every day (twitter, facebook, yahoo etc etc).

You could flip a coin and make a decent choice on this one.

But bare in mind since I don't know what you are writing I can't comment as to whether this is the right pair of languages to be choosing between. Just don't use them for scientific computation or HPC.

Lots of people use Python for scientific computation and HPC. It's widely used as a Matlab replacement. Both are really just wrappers around fast C algorithms so their performance is actually quite reasonable considering the benefits of rapid development.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,701
4,661
75
What's Coco?

It looks like an "a" was forgotten.

http://rubycocoa.sourceforge.net/

The wiki is currently unavailable.

Error: Unable to connect to the MySQL database.
:hmm:
OK, let's try Wikipedia.

RubyCocoa is a Mac OS X framework that provides a bridge between the Ruby and the Objective-C programming languages, allowing the user to manipulate Objective-C objects from Ruby, and vice-versa. It makes it possible to write a Cocoa application completely in Ruby as well as to write an application that mixes Ruby and Objective-C code.
I guess it's an Apple thing.
 

uOpt

Golden Member
Oct 19, 2004
1,628
0
0
I much preferred Ruby over Python but I mostly gave up on scripting languages like that and now I can't remember why. Both pissed me off by making incompatible changes to the languages, changes that can't be automatically adjusted to or detected in libraries, just to support internationalization better.

Python is most definitely more popular in the industry. There are more large frameworks out there for Python. Let's look at the Twisted framework as an example, which doesn't have any equivalent.

Ruby on Rails is very nice. It's not so much that it is superior technology to other quick web thingies. But they have critical mass behind one very nice framework and Python has several different similar efforts.

Ruby has continuations which might help learning some things about programming. On the other hand it's interpreter is even slower than Python's, as hard as that is to believe.

Overall I found "languages like that" to be more trouble than worth. I always ended up in performance bottlenecks, in particular when accessing characters inside a string. There is no SMP-enabling threading. There is no compile-time type checking so you have to write more assertions in a bigger test suite. You always have to go through a translation layer to use any random C api, not to mention C++ APIs.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
I much preferred Ruby over Python but I mostly gave up on scripting languages like that and now I can't remember why. Both pissed me off by making incompatible changes to the languages, changes that can't be automatically adjusted to or detected in libraries, just to support internationalization better.

Python is most definitely more popular in the industry. There are more large frameworks out there for Python. Let's look at the Twisted framework as an example, which doesn't have any equivalent.

Ruby on Rails is very nice. It's not so much that it is superior technology to other quick web thingies. But they have critical mass behind one very nice framework and Python has several different similar efforts.

Ruby has continuations which might help learning some things about programming. On the other hand it's interpreter is even slower than Python's, as hard as that is to believe.

Overall I found "languages like that" to be more trouble than worth. I always ended up in performance bottlenecks, in particular when accessing characters inside a string. There is no SMP-enabling threading. There is no compile-time type checking so you have to write more assertions in a bigger test suite. You always have to go through a translation layer to use any random C api, not to mention C++ APIs.

Thanks for your insight.
We're mostly interested in Python or Ruby, and in addition someday a little Google Go, which appears to be an interesting, sensible, systems language.

It seems like Python (on Django) is considered its greatest strength being maintainability (which is pretty important for a web application I'd assume, if not paramount) and Ruby's is its "magic" and tools available and just general massive push behind Rails itself.

I think personally, I'm going to sit down and spend time with both Python and Ruby because there's a lot of love to go around for both languages.
 
Last edited:

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
Was referring to CoCo, ie. CompilerCompiler :)
http://www.scifac.ru.ac.za/coco/

Wrote a Verilog parser in CoCo/R - was surprisingly less convulted and complex than writing it in say straight Perl.
That is cool, I'll look into this.

Here are some interesting comments about Ruby that you might find helpful by a guy who's a great programmer
Encountering Ruby
Interesting read, I notice it's from 2006 though. I usually tack on a '2012' on the end of my searches to be sure I'm getting the "latest" opinions since there are so many changes over the years, but I still find his article valuable and interesting.

My friend is working on Ruby right now. I decided I'm going to dip my feet in Python personally, I've had success (and fun) with it just using simple gedit and powershell combo.
There's so much hype around Ruby though, that I really want to take a serious attempt at that as well. I don't know why it's so popular but it's definitely popular, or at least it was in 2006-2008. I chose Python to try first myself because it seems much more widely used and seems fit to rapid application development as well. I notice there's a lot of Google support and backing of Python that is encouraging and makes me feel like every bit of energy I spend on it won't be down the drain tomorrow.
 

cdr

Member
Sep 1, 2010
27
0
0
www.heatware.com
I'll echo that ruby vs python doesn't really matter, they're both great.

Which you want to pursue may depend on what you want to do with them.

Speaking only to my impression of the web development landscape, Ruby/Rails/Sinatra is more mature and Python/Django/Flask is more upcoming and 'hot' at the moment. Python web development is a little more exciting right now because it's the more trendy of the two, but python web development will probably mature and cool off and become even more like Ruby soon enough.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
I'll echo that ruby vs python doesn't really matter, they're both great.

Which you want to pursue may depend on what you want to do with them.

Speaking only to my impression of the web development landscape, Ruby/Rails/Sinatra is more mature and Python/Django/Flask is more upcoming and 'hot' at the moment. Python web development is a little more exciting right now because it's the more trendy of the two, but python web development will probably mature and cool off and become even more like Ruby soon enough.

I'm more into sys admin work, so I thought if I'm going to dabble with my buddy I'd go Python primarily because I'm under the impression it would apply to more than just web development. Is this correct or is Ruby used as much in shell scripting?

Also, I've searched and read a dozen webpages about DSLs, I know what they are now but can someone explain if this is a big deal? It seems to be a huge hype for Ruby but I can't come up with any reason to be creating DSLs all the time- or how this is a massive advantage. Are the only other languages besides Ruby to create DSLs extremely more difficult to work with, ie. C?

Please excuse my ignorance in advance