2

I'm considering learning a new language as an alternative to PHP. I'm considering Python and Ruby. Which one is a better language based on the following four criteria, and any other qualifiers you may have?

  • Which is more stable?
  • Which is more scaleable?
  • Which is more secure?
  • Which is easier to learn?

EDIT:

Keeping the original question intact, I'd like to add one more pair of questions.

  • Which is quicker to code with?
  • Which is quicker to learn? (Based on personal experience only please - to avoid holywars.)

EDIT2:

Sorry for not clarifying - mostly web development, some desktop programming would be a nice bonus.

8
  • 2
    This should probably be a community wiki Commented Sep 28, 2010 at 5:41
  • 2
    Sensitive topic, usually works best as community wiki. Commented Sep 28, 2010 at 5:42
  • 4
    the answer to the title of the question is yes please. But of course the answer to the other four questions is python ;) Commented Sep 28, 2010 at 5:42
  • @AaronMcSmooth - Great Answer! @Nakilon - This is not a Holywar. I'm seriously asking this question. Commented Sep 28, 2010 at 5:49
  • 2
    @Moshe — you don't have to try to start a holy war in order to start a holy war (and, obviously, you should forget about Ruby and Python and go with Perl) Commented Sep 28, 2010 at 6:07

8 Answers 8

19
Both are stable 
Both are scalable 
both are as secure  
Both are easier to learn !!

So what matters?

Your taste. Taste them both and proceed with one that seems more palatable :)

Sign up to request clarification or add additional context in comments.

3 Comments

I totally agree. I came from a PHP background and ended up learning Ruby and Rails but my main reason for making that choice was access to an excellent mentor to show me the ropes. @Moshe -- If I had to pick a reason to choose one over the other that would be it, go with one where you have access to someone with a good understanding of the language and you'll have a much easier time learning it.
@Ganesh Shankar - Well, a friend of mine does Python, so that may settle it.
There are also more concrete supplementary issues like availability of necessary third party libraries, community and documentation but I agree with your general analysis.
3

These two languages are so similar that any strong preference will be mostly subjective. They are both the correct answer.

Comments

2

I personally would prefer Ruby, as it goes wonderfully with the Rails framework and is a blast to learn and to work with.

I have only used Python a few times. While I know it is powerful, I have never really fallen in love with it the way I have with Ruby (and specifically the Rails framework)

1 Comment

Thats the point!. I started out with both ruby and python and I have only continued to use python as it tasted better to me. :) There is not much that makes them different from each other.
1

To get a quick feel for each and see which one "tastes" better I would suggest taking each one for a spin on a selection of problems on ProjectEeuler. PE is more about algorithms and math but some of thee simpler problems are a great way to get going with syntax and some core library features such as file IO etc.

1 Comment

Interesting. ... Link for PE please? (I'm Googlazy.)
1

No significant difference on the first four criteria.

No significant difference on coding speed either - you're going to be slow in both at the start, then you'll get faster. Ruby may be slightly better at managing libraries (Ruby Gems) but Python probably has slightly broader library coverage. No big deal either way.

Coming from PHP, I'd guess that Python might be slightly quicker to learn. That might be a reason for choosing Ruby - you might learn a little more.

There are a lot of "mights" and "slightlys" there. That's because the two languages are much more similar to each other than either is to PHP. Neither is particularly hard to learn - I'd suggest spending a little time with both and then going deeper with the one you prefer.

1 Comment

+1 for the Zen part about taking the slightly longer way learning. :)
1

i think you should prefer ruby, while python is assumed easier to learn!

python is so friendly great language but you rarely find servers with python support most are expensive one's, ruby on rails is great framework many frameworks for other languages are drives from , great cake php is a sort of such a thing.

ruby on rails can be found on many servers. how ever if you have specified applications with special clients you can go to python and it's funny frameworks.

by the way, i had a lecture on ruby i had a article claim that ruby is a bit more efficient and more quick.

2 Comments

run a VPS and install the python version you want.
dear christopher mahan Vps cost too much more than a simple web host not public usage is possible, ypu can't force your clients to pay for vps for dedicated or a expensive server.
0

http://c2.com/cgi/wiki?PythonVsRuby

http://www.nextdoorhacker.com/2010/02/ruby-vs-python-battle-to-death/

http://blog.peepcode.com/tutorials/2010/what-pythonistas-think-of-ruby

Just at the top of the Google results. I've read most before; good articles all. Fundamentally, they are very similar; there are a couple of important philosophical differences that make it a trollworthy subject.

Comments

0

pyfunc pretty much said it, but I'd like to offer two more thoughts:

1) Ruby will probably end up being a tiny bit more familiar as it a) can often optionally use a more C-like syntax, b) is not structured quite as foreignly as Python coming from PHP

2) They can both scale well, but Python will probably give you the most bang for your buck (CPU wise - and if you use Ruby, you're probably pretty well off using Ruby Enterprise and mod_rails, aka phusion passenger).

That's all - even considering those points, the difference may well be negligible, as the power of the language is all about how you use it, regardless of its inherent pros and cons.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.