|
|
|
|
|
by franparga95
4367 days ago
|
|
Hey there! I've just started learning to code for building web apps (I know about Fortran 90, it doesn't fit very well on the browser haha), and it took me a while to decide. I looked up in an endless number of hacker websites, but at the end I'm sorry for betraying Python lovers... I'm learning ruby on rails..! I've just started learning, please tell me If it's best to learn python (I'm not looking for an easy language, but for a powerful and versatile one :) Something to develop some ideas I have.. First post on HN!! :D From the center of Spain! |
|
While Python has a healthy web dev ecosystem, Ruby's feels much larger to me. That's almost certainly because Rails is so wildly popular. And Rails is an excellent, mature framework. So for web dev, I would consider Ruby the winner.
Python is the clear winner for scientific computing. That's not really due to anything inherent in the language. It's an ecosystem thing. If you were using Fortran before, you might be working in a problem domain where Python dominates.
Both are excellent for miscellaneous scripting work. E.g. reading in a CSV file and doing something with each row; batch-processing a bunch of images; renaming 1000 files according to some ruleset; gathering some system data and sending nightly status emails.
In terms of syntax and features, they're very very similar. Python has meaningful whitespace, which you may like or dislike. (I think it's good for enforcing proper formatting, but you're free to disagree.) Ruby has multiple ways of expressing the mathematical concept of a function (methods, blocks, and procs), which has its pros and cons. Both have metaprogramming facilities, though I find Ruby's more pleasant. If I remember correctly, it was in large part the metaprogramming that made DHH pick Ruby for Rails.