Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby vs Scala - pros and contras of each one [closed]

What benefits and limitations has Scala language comparing to Ruby, especially from the web applications developer point of view? Comparison charts and proof-links are strongly welcome.

P. S. This is not a holy war question (-:

like image 258
Andrei Petrenko Avatar asked Oct 13 '11 11:10

Andrei Petrenko


People also ask

Is elixir like Ruby?

Elixir is a functional language, whereas Ruby is naturally object-oriented (although it also supports functional programming). Wrapping your head around the difference in approach to programming in this way can be an obstacle.

What is Ruby and Scala?

Ruby and Scala can be primarily classified as "Languages" tools. "Programme friendly", "Quick to develop" and "Great community" are the key factors why developers consider Ruby; whereas "Static typing", "Jvm" and "Pattern-matching" are the primary reasons why Scala is favored.

Is Scala more powerful than Python?

Performance. When it comes to performance, Scala is the clear winner over Python. One reason Scala wins on performance is that it is a statically typed programming language and Python is a dynamically typed programming language. With statically typed languages, the compiler knows each variable or expression at runtime.

Why use Ruby programming?

Ruby is mainly used to build web applications and is useful for other programming projects. It is widely used for building servers and data processing, web scraping, and crawling. The leading framework used to run Ruby is Ruby on Rails, although that's not the only one.


1 Answers

I've been working with Ruby and Rails for over 2 years and I'm just about a month into learning Scala and Lift, so my opinion is probably biased, but here it is.

Ruby makes you feel amazing. Every new thing I discovered about the language made me giggle like a little schoolgirl. Working with gems is really simple and with Bundler and Gemfiles it is probably the best library management system I've came across.

There are loads of gems for everything, from API wrappers, to complex authentication/authorization.

Ruby also has amazing community that will make learning the language really really easy. Take RailsCasts by Ryan Bates for example. If you watch them, you will learn how to do web development with Ruby and Rails.

For me, Ruby is probably the best thing I've discovered in my whole programming life, because the way the community works made me change my whole approach to programming.

On the other hand, I don't see this in the Scala world. I don't want to raise a flame war, but this is just my impression after just starting to learn the language. In Ruby community, everything felt so engaging and made me wanna learn more and more. But with Scala, I tend to run into a lot of obstacles and not as much documentation and tutorials, that would help me overcome them.

There are tons of books devoted to very specific topis on Ruby, be it scripting, deployment, testing, and bunch of other stuff (yes Pragmatic Programmers rule). The best thing is, that the whole community feels like a family, it's not the same as in the Java world, where everything is distributed and nobody talks to eachother, at least that's my impression.

So what this comes down to, at least for me, is how easy and engaging it is to get into the world of the language and start doing something, and Ruby is definitely a winner here, at least for me.

On the performance side, Scala is faster, no doubt about it. That's one of the reasons I'm getting into Scala, as it has really great concurrency model and allows you to do things that Ruby just can't do. But for most web applications, you won't need to do this.

Ruby is slow, that's the only downside there is. It is getting faster and faster, and for 98% of the cases you won't see it as a problem. But Scala is faster.

Ruby community also embraces testing and beautiful code, which naturally leads to better apps.

like image 188
Jakub Arnold Avatar answered Nov 08 '22 00:11

Jakub Arnold