

On the other hand though, it’s been a cash cow that’s changed the community forever by attracting all kinds of attention. On one hand, it gave many developers the chance to appreciate the design of the Ruby language based on its own merit. It brought sudden popularity to the language with all the consequences, good and bad, that usually result from exponential growth. Rails has been a blessing and a curse for the Ruby community. Ruby works fine if object responds to method, you can do list.map. In general, file loading logic is a big pain in Ruby. I call that, and raise you File.expand path("./somewhere", _FILE_) just to refer to relative path. In Ruby you can abuse tons of "include" for the same effect and having the same problems (much of Rails is built that way), instead of more structured composition. Most new languages don't either, even those inspired by C/C++. I use Ruby and love it, but I don't feel some of the points here are fair. There are days I'd have considered killing to have tags/symbols in Python. Quoted string dict keys instead of :symbols (Ruby) That said, a few of the reasons mentioned really stand out to me as a Python developer.Ĭongrats, you've stumbled upon my absolute most hated thing about Python.

If data is returned from a function/method, intentional or not, people will use it.
PYTHON VS RUBY ON RAILS CODE
This can cause a lot of issues when gems are updated, especially when the Ruby community is so reliant on the code itself being the documentation. People often return things from functions/methods they didn't intend do such as references to internal structures, etc. Examples of things this makes trivial: Pub/Sub, Plugin systems.Įxplicit return instead of everything an expression (Ruby) I admit this property isn't always useful, but when it is there really are not any clean alternatives. One of the key things decorators do is that they are evaluated first on file load. I've actually wished these existed in Ruby. I make no claim of virtualenv being perfect, but I have to admit I've had significantly more issues with bundler than virtualenv. Just a couple of things I actually have to disagree with here. I'm primarily a Python programmer but I much prefer most of Ruby's syntax. Ruby also leans heavily on functional concepts, which will aid you when you inevitably pick up functional languages. You'll be able to transfer the knowledge to other OOP languages quite easily. In the end, since you're just learning OOP concepts, either will work totally fine. Python also has a web framework, Django, which is moderately popular and follows in the footsteps of Rails. Python is (was?) huge at Google, and is also very popular within scientific communities due to the good support of mathematical libraries like NumPy, matplotlib, and others (I know much less in this area). I also use Ruby for day-to-day shell scripting as a much nicer alternative to bash. Chef, which is used for configuring and managing servers, is Ruby (although you can deploy any kind of server with it, not just Ruby/Rails ones). Projects like Ruby on Rails, Sinatra, and Jekyll are still going strong.

In the web development world, Ruby reigns supreme. I wouldn't say one has "more" developers than the other, but due to the libraries and communities that have developed around them, you will find their popularity varies in different circles. Python and Ruby are both very mature languages with good standard libraries and a huge collection of supporting libraries ("gems" in Ruby parlance). Yet, I can't say the same for Ruby vs Python. Is there any reason why I couldn't just forget about Python and focus on Ruby instead of it? Are there any concrete examples where a program would be better suited to Python than Ruby, or vice versa? I know that languages are just tools to solve problems with, but it is easy to choose when to write a program in Python over Java, for example. Why does it seem that so many more people write in Python compared to Ruby? Does Python offer better performance? I'd imagine that Python has a more vast collection of libraries to offer, but this, again, would mainly be down to the fact that it is more commonly used. It just comes across as the most user-friendly language I have written in so far. However, for some reason I find myself preferring Ruby over Python. With my lack of experience in both Ruby and Python, I see them as two very similar languages - a program/script written in one could be translated into the other very easily. (although I do still thoroughly enjoy these languages).

I find it very refreshing to write and read compared to C, C++, Java etc. I have had quite minimal usage of Python over the past year. I am a CS student and we have just begun studying OOP in Ruby this semester.
