It has often been said that you should never talk politics or religion with strangers. With developers, it is always risky to ask which programming language they prefer because you will get an earful. Risks aside, I had a great discussion with Alex Randa, one of Sphere’s amazing full stack developers about when you should use Ruby vs Golang.
This topic was discussed at a TechDebate earlier this year. To attend future debates register at www.techdebates.org. We’re always on the lookout for debaters – if you have something to say, let us know: https://techdebates.sphereinc.com/debater-registration
Today, there are many technology options available to both developers and those working to accomplish business objectives. Often, such as the Ruby vs. Golang issue, there are passionate opinions and debates on both sides of the fence. This is why we sponsor TechDebates.org. Technology leaders across a wide variety of industries get together to explore the issues of the day and to exchange ideas.
At the end of February, we held a TechDebate in Kharkiv to discuss the strengths and weaknesses of both Ruby and Go. Alex Randa, one of our full stack developers at Sphere Software, brought his more than eight years of software development experience to the discussion. After the TechDebate, I had the opportunity to talk with Alex a bit more about the topic.
LG: Both Ruby and Golang are now common programming languages. What are the strengths and weaknesses of each language?
ALEX: Ruby is a lot faster for development. Part of the speed of using Ruby is that there are large, open-source libraries where you can grab basic solutions. As just one example, by using existing code that can be found in a library, you can create an administrative panel in a few lines. Development speed, community, gems (libraries) are the most powerful part of Ruby.
It is also a great language from a developer perspective because it is fun to write in and is very dynamic, you can develop anything. Also, you can write and read code in a very straightforward manner – in plain English whereas Golang requires you to write program code.
Ruby’s weaknesses are generally all centered around problems with memory and performance. Because it is a dynamic and interpreted language, you need quite a bit of memory and a robust central processing unit (CPU) to run it.
While Ruby has a very rich syntax that is a bit complicated for beginning programmers, Go is a very simple language with a small number of language constructions. You can spend one week learning the language and then start writing. It is in fact very similar to the C programming language.
Because you compile Go to a binary, executable file, it is a lot faster, and you can run it on basically any system and processor type. It does not use nearly as many computational resources as Ruby does and, as I said, can run a lot faster.
LG: When is Ruby a better choice? When is Go the better choice?
ALEX: Golang programming is ideal for solving both simple and complex, multi-threaded tasks. It is actually the most powerful language if you are building networking services or command line utilities. Specifically, Go is good for low-level applications if an API and no business logic is involved for example – any types of applications without business logic.
Ruby is an excellent choice for startups and projects with a lot of dynamic business logic. With some projects, the requirements change every few days, and it is faster to make these changes when programming in Ruby. Additionally, Ruby is great for creating website applications, but it is not very good for creating desktop type of applications.
LG: Do you think both of these languages will continue to exist or do you think one will replace the other?
ALEX: Both languages have their strengths, and in my opinion, both will continue to exist. Actually, sometimes I use both languages in the same project.
I typically advise clients to start with Ruby because it is so much faster from a development standpoint. Many times, speed is of the essence to begin building a business or a new solution. As the business or application grows, switching to Golang or Java or any compiled programming language may be necessary to facilitate scalability and to reduce the amount of computational resources required. But, getting started quickly with Ruby is usually a good choice.
To learn more about the choice between Ruby, Go and other programming languages, watch for upcoming TechDebates being held around the world.
Our company, Sphere Software, is a sponsor and organizer of TechDebates