开发者

Ruby or Python instead of PHP?

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.


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


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


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)


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.


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.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜