DEV Community

Cover image for Learn a New Language: Ruby or Go?
Marc Nevin
Marc Nevin

Posted on

Learn a New Language: Ruby or Go?

I'm lucky enough that I can take my time on lockdown to build some backlogged projects, draft some posts and develop some new skills, one thing I've been thinking about is learning some core concepts of a new language.

After looking at what I enjoy, what's popular and what's actually used, I've narrowed it down to Ruby and Go,

The case for Ruby

So many tools I love to use are built with Ruby and loads of great websites are written in Rails. Makes me think there's some real utility there I could start leveraging in my own solutions, not to mention Rails opens a new avenue for webdev!

The only hold-ups I have, it's not got a popular reputation locally, there are a few product teams that use it and talk regularly about how there's not many jobs in it and that they hope to migrate to something else...

The case for Go

Go has a certain appeal to me - most of my stack is Python-based with some JavaScript, using AWS; I used to work in a C/C++ stack and the promises of efficiency, combing my old domain with my current and "easy" integration to my current stack make it hard to not notice.

And again a lot of great tools and services are being built in it or things that were once Python (still my fav) are being ported to Go now, it seems a little less broad spectrum of services built with it?

Decisions, decisions

I'm leaning towards Go, but want some input, I know very few people who actively use either to draw from, anything I've found normally has a strong agenda, so I want to ask here, see what people think and crowdsource some opinions!

Which would you recommend starting with and why?

or if you've any strong experiences working on either, think one is easier to learn etc etc

Oldest comments (63)

Collapse
 
phantas0s profile image
Matthieu Cneude

Here's my opinion:

It doesn't matter. It's difficult to predict what language will be more used than the other in 5 years, if interesting company will be more on the Go or Ruby stack, and so on.

It doesn't matter because more language you'll learn, easier it will be for you to learn new one. It looks like you already have a solid background in low level languages, so it shouldn't be a problem. You can still learn the one you didn't pick later.

Development is not about languages, it's about choosing the right tool to find the best solution.

Collapse
 
m_nevin profile image
Marc Nevin

Very very true, languages are tools; part of the reason I want to pick a new one up is to expand how I think when designing solutions - each new tool opens new possibilities or techniques

Quite a pragmatic way of looking at it but I definitely agree with you

Collapse
 
phantas0s profile image
Matthieu Cneude

That's a very nice goal. Learning a new language is always a very interesting experience.

Personally, I try to learn new languages which are different of what I use everyday, to learn a maximum. That's my only criteria.

I wrote about how to learn a new language here if you're interested.

Thread Thread
 
m_nevin profile image
Marc Nevin

That's a good way of scoping it, I'll definitely take a look thanks!

Collapse
 
cleysonlb profile image
Cleyson Leal Braga

Golang... becouse Ruby is dying

Collapse
 
deciduously profile image
Ben Lovy

[citation needed]

Collapse
 
cleysonlb profile image
Cleyson Leal Braga

Most companies are migrating from ruby ​​to Elixir, ruby ​​has gained fame because of rails, but nowadays there are several other development alternatives as good, including using node

Thread Thread
 
ludamillion profile image
Luke Inglis

Most companies are migrating from ruby ​​to Elixir

[citation needed]

I keep hearing that but I have never seen anything indicating that most companies are doing this. I've seen a little more evidence that companies are choosing Elixir (or something else) over Ruby/Rails for greenfield projects. But to imply that most companies are actively migrating legacy apps to Elixir is a big assertion to make without evidence.

Thread Thread
 
thepeoplesbourgeois profile image
Josh

My experience has been that Ruby-embracing companies have done very little, if anything, to attempt to transition over to Elixir, for either greenfield or legacy established codebases. Even given the familiar syntax and strong guarantees of concurrency, performance, stability, and flexibility, there's an incredible inertia within teams that have already built up their Rails projects.

Thread Thread
 
ghost profile image
Ghost

I think this is usually a moot discussion because it depends on the local market, we are working all over the world, in some places Ruby may be dying while in others is growing, in some maybe never arrived, it also depends in the circle we operate, even the specific industry we tend to focus. We probably will think our current stack is more popular because of course we have more people surrounding us using it, we probably look for job offers that favors what we know and use, for obvious reasons. Of course to me Java looks less popular, I hate it, I don't even look at job offerings that require Java, so I have less chances to talk with Java people, I don't go to their Meetups nor watch Java YT videos, that doesn't mean is less popular, no idea. And even if it where, that just tells me that is less popular in my city, in the industries I'm closest to, nothing more.

Collapse
 
cleysonlb profile image
Cleyson Leal Braga
Thread Thread
 
deciduously profile image
Ben Lovy • Edited

Every link here suggests the opposite of what you're asserting. Even the graph showing it on the bottom of those four tools shows it has remained steady, not declined.

No, Ruby isn't poised to ever replace or even compete with C++ or JavaScript, but there's also nothing to indicate it's going anywhere for a long, long time. Yes, there are some companies that are migrating to Elixir, but I haven't seen anything suggesting that "most" companies are doing so is accurate. Instead, Ruby is continuing to mature and has a very well defined niche in the industry. The fact that many large systems (like GitHub, or DEV, AirBNB, Stripe, etc, etc.) continue to use it. Rails is declining, but Rails is not all of Ruby, and both Rails and Ruby continue to receive active ongoing development both in terms of core tools and ecosystem. It can both be alive and well and not the #1 language on ranking lists. There's gonna be Ruby to maintain for a long time, and on top of that there's still brand new Ruby code churning out too.

Thread Thread
 
cleysonlb profile image
Cleyson Leal Braga

In your argument you are defending legacy code ... it is the same as saying that PHP is growing because the internet uses wordpress, and saying that PHP is a great choice for 2020

Thread Thread
 
deciduously profile image
Ben Lovy

I don't know that I'm trying to mount a defence, just observing. Ruby has been "dying" since like 2007 but still has yet to actually get around to it, and I don't think anything is different now except that the language itself is much, much stronger than it ever was back then. I try not to feel too strongly one way or another about these things on a personal level, it's all just tools for a job. Ruby is a pretty good tool, I don't think it's accurate to say that Ruby suffers from the same inherent issues as PHP for greenfield development.

Collapse
 
sergix profile image
Peyton McGinnis
Collapse
 
itachiuchiha profile image
Itachi Uchiha

Is there any proof? For example, the lowest commit counts can be an example. You can say there are tons of issues that haven't closed yet, etc.

Collapse
 
madeindjs profile image
Alexandre Rousseau

I really depends to your needs. But Ruby has a great ecosystem to build large application without reinvent the whell. If you choose Ruby on Rails you can build an API compliant to JSON:API standards with JWT token auth, email validation, unit test and even deploy on Heroku in only one hour. Check my free e-book if you don't believe me.

With Golang you may spend this hours to choose the right library.

Please do not listen people saying Ruby is dying. Github himself run on Rails 6.

Collapse
 
guivinicius profile image
Guilherme (Harry)

Why not take a chance on both?

I've been working with Ruby for the past, 10 years I guess and I think it's far from being a "rejected" language. There's always a company using or a startup starting on top of Rails or any other framework, like Sinatra.

Go is really interesting and is one of the languages I'm starting to learn also. I decided to learn because I've seen so many interesting projects using it that I want to at least be able to contribute.

Ruby is really nice and easy to learn and if you get Rails right, it's a powerful tool for new ideas.

Collapse
 
m_nevin profile image
Marc Nevin

I've heard a lot of people promise Rails as this one-stop-shop for prototyping which is pretty interesting but I think you're right no reason not to try both,

Responses here have highlighted a lot of good points of both that are worth trying out before longer-term ambitions with one!

Collapse
 
guivinicius profile image
Guilherme (Harry)

I mean, there is no "silver bullet" in our industry. That's why there are many languages, architectures, protocols and etc. Each one has its purpose.

Without going further on the subject (that could increase a lot, discuss market, current and future world economy and etc) I think you could think about a project that you could achieve on both languages, as an API that you made on Python to talk to an IoT device.

That way you will be forced to learn about some libraries in both languages and learn the differences, which could even lead to another cool article here. 😉

Also, you say that Ruby doesn't have any local community where you are, I see that as an opportunity to start a study group there. I bet there are many other local programmers that heard about Ruby or Go but don't start anything because they think no one is using locally.

🔥 You could be the local spark bro! 🔥

I think that's it ... code on both, be the spark and keep rocking. 😄

Thread Thread
 
m_nevin profile image
Marc Nevin

That sounds like a solid idea, trying out some of the main libraries and on-device would make a really interesting test of both languages, and like you say... that's post material right there!

Oh sorry - to clarify, there's a bit of a community, but its... not the most positive bunch, they may have changed since I last took a look but both have very small followings here. I do have 2/3 of my meetups subs free... mightn't be a bad idea to try and engage them again,

Thanks for the guidance man!

Collapse
 
madza profile image
Madza

for future perspective definitely Go, for beautiful and easy to pick up syntax Ruby

Collapse
 
ludamillion profile image
Luke Inglis

...for beautiful and easy to pick up syntax Ruby

Whenever anyone asks 'should I learn Ruby or X' I almost always answer X. Ruby is an incredibly easy language to pick up so spend your time learning something else and then if you ever need Ruby you can pick it up quickly.

Collapse
 
madza profile image
Madza

Fair enough, some even say the most appropriate 'first programming language' is Assembly. Get to know the core and then move up to higher languages with ease, based on necessity.

Thread Thread
 
ludamillion profile image
Luke Inglis

I learned with C which certainly isn't quite so close to the metal. It is close enough to make me appreciate what higher level languages take care for you. It does help to be able to dip into the C source as one sometimes has to when digging around in Ruby.

I have written some Assembly but mostly just out of curiosity

Collapse
 
geoff448 profile image
Collapse
 
256hz profile image
Abe Dolinger

I mean if you're gonna go by Stack Overflow trends, you might as well learn Python, Java, or C#. Even Typescript is much more popular than Ruby or Go. insights.stackoverflow.com/trends?...

Collapse
 
freedom profile image
Freedom • Edited

I'm also one of million require to work from home this month. Both has great backward compatibility stories except performance are day and night, one thought about Go built-in html/template isn't efficient since it escaped strings behind the screen, alternative template engines libraries can help when you need performance. I choose Go because Crystal language an alternative take too long to compile and work well in a secure server without having to install any runtime or compiler.

You could start reading at Rosetta Code to compare side-by-side and I feel it a lot productive to learn with any utility that can assist you to compile source code and execute when you make changes to your code.

rosettacode.org/

I hope, line of code will not be the main factor in choosing a language, keep writing and get used to it.

Collapse
 
allentv profile image
Allen T.V>

If DevOps and tooling is something that you are interested in, then definitely look into Golang. Most of the recent tools in infra is built with Go. It will take some time to ramp up but should be ramp easily once you get a grip on it.

Collapse
 
david_j_eddy profile image
David J Eddy

I feel like this is a more a question of what is the right tool for the job? In my mind I see Golang as a system tools language, whereas Ruby/Rails is a web app language.

Collapse
 
brownio profile image
Antonio Djigo • Edited

I would go for Ruby only if you are going to do Web Development, Rails its awesome, curated, etc, ruby syntax is lovely.

If you are thinking about "A language I'd like to use for almost everything I do", I'd go with Go.

Both are awesome, but Go is growing better in my opinion, also, the Gopher logo is way cooler

😎

Collapse
 
m_nevin profile image
Marc Nevin

Ahh nice, this is the sort of response I was hoping for!

I'm leaning to Go but a few raised the point of trying both so I'll have to look at both your posts :D

Collapse
 
brownio profile image
Antonio Djigo

Glad it helped!

Collapse
 
ziizium profile image
Habdul Hazeez

I'll just Go and find a Ruby.

Collapse
 
weirdmayo profile image
Daniel Mayovsky

If the "tools I love are built on" factor is important to you, I'd recommend Rust instead of Go. A lot of C++ and C programs (cat, grep, etc.) are being rebuilt on Rust, and the language's community is thriving, so I would recomment Rust over Go, if you'd rather stick with a compiled language.

Collapse
 
schererja profile image
Jason Scherer

In my mind, pick one, however I do believe one thing, people looking at the trends can mean nothing. What also makes the trends look lower is honestly there are more languages to look at now so yes it maybe down for certain things. Many startups still use Ruby and Rails as it something to get a product out there fast as an MVP. While Go is nice, there are still some things that I find weird about it and pretty hard to get used to.

Best thing is, pick something and make cool things. If it for a job in the end, find what is the typical languages around you and learn that. If for fun, pick something, you may get halfway through the project and realize it isn't what you wanted anyways.

Collapse
 
cocampbe profile image
Court

Go.

Collapse
 
brownio profile image
Antonio Djigo

It is! I just think that Ruby experience in Web dev is more pleasant and everything is better pavement (the more years of usage the framework has, the more refined it is)