Hello everyone, hope you all are doing well and are safe. I am a bit new to the Rust reddit but have really enjoyed reading everyones posts.
Hi had a question regarding learning Rust or Go in 2021. For context, I am currently an undergraduate student at university, and wanted to pick up something new that would be fun and advantageous for my portfolio. I have mostly done web development (specifically using the React Framework), but have also done a fair amount of C/C++. I like programming, and wanted to learn something new and two languages that immediately caught my eye were Rust and Go.
Since I am still a student and will soon be looking out for jobs and internships, I was wondering which language should I try picking up. From what I understand, Go is already pretty established in back end development and cloud, and is a bit more of a popular choice. However, just this year Rust has also become very popular, with more and more companies like Microsoft and Google starting to adopt it, and so it's a little difficult to see how the languages are moving in the future.
I was wondering if you all could maybe provide some guidance to help me kind of decide which I should learn and invest some realtime doing. Thank you!
PS: English is not my first language so if there are some grammatical errors I am terribly sorry.
Although Rust and Go are often mentioned in the same context, they are very different languages, with different pros and cons, different ideal use-cases. Give both Rust and Go a quick try to forge your own opinion of how much fun they each are, while keeping in mind that Rust's initial learning curve is much steeper.
From a job opportunity PoV, given how simple Go is, most companies will happily teach Go to C/C++/Rust devs, while the reverse (teaching Rust to Go devs) is a harder sell.
If you want to work as a c++ developer, rust might be a better choice. It will teach you ways to construct your code, which directly translate to better c++ code and give you a nice mental model for ownership.
If you are very advantagous and want to learn something completely different, Haskell or Ocaml are nice choices, too.
Go is a solid choice, but is boring - by design. That is not a bad thing per se, it is good to get things done. But the language itself is not that expressive, IMHO. As always in life: a matter of preference
Rust vs. Go NO, it's Rust and Go.
Why Go and not Rust?
Rust vs Go
Golang Vs Rust: Which One is Best for You | Optymize
These kinds of articles keep popping up from time to time, and they're always pretty poorly written and don't contain much thoughtful or useful comparison between the languages. This one, for example, seems heavily biased towards Go and doesn't really do a fair comparsion between them, really just saying "Go is better than anything else except for this niche areas" which is objectively untrue for almost any language.
Golang, also known as “GO”
No, it's just called "Go". Not capitalized, not Golang, just Go. It may be referred to as "Golang" at times but that's not its proper name.
GO is the most easy-to-learn programming language in the world
[Citation needed]
Hence [...] it has become a popular choice among future Golang developers.
Who would have thought that Go is a popular choice among future Go developers?!
According to stack overflow’s 2021 developer survey Go is the 14th most used programming language, and is preferred by 62.74% of developers for daily use [...]
It is indeed the 14th most used programming language, but it's also only used by less than 10% of respondents, so it's immediately hard to believe that over 60% of developers prefer it for daily use.
What the 60% figure actually represents is "proportion of existing Go developers who want to continue using Go". 60% is not particularly good, but it's not particularly bad; Go is 10th ranked by this metric, far behind languages like TypeScript and Rust (which is ranked first with over 85%).
More than 86% of developers use Rust for development daily [...]
Again, this is wrong. According to the referenced survey, only 7% of developers used Rust during the last year. The 86% figure is, again, the number of Rust developers who want to keep using Rust.
Concurrency is something every programming language should have, as it benefits coding by using the CPU to its full extent. [...] In simple words it uses CPU fully to provide developers with the quickest compile time.
Concurrency has absolutely nothing to do with compile times. This wording also feels like it's confusing concurrency with parallelism, since concurrency is often used in contexts where you're not doing CPU intensive work.
Rust takes it to the next step by introducing colors in error messages which catches the eyes of every developer to fix them.
I mean, I get the point being made here but it's not the colors that are the helpful part of the error messages...
Also, highlighting "helpful error messages" without highlighting the many cases where Rust turns common runtime errors into compile time errors is, I believe, doing the language a disservice.
iv) Secured Memory
Compared to most other languages, Rust actually has less secure memory. It's only when compared to older systems languages like C or C++ that it's got a more secure memory model. Garbage collected languages are almost always more secure, on the flip side they can often manage their memory less effectively than systems languages do.
Moreover, GO and Rust are well known for their concurrency, which allows them to utilize multiple threads of CPU for quick functioning
Again, this is mixing concurrency with parallelism. You can have concurrency in a program without having multiple threads (for example in JavaScript), and you can have multiple threads without having concurrency (for example in C).
if we take GO then we are bound to perform well in the case of web development, docker, application development and Kubernetes as it was initially built to develop these solutions only.
[Citation needed]
Just because a language is built for a certain area doesn't mean that it can solve any problem within those areas well. Granted, there are surely many problems that can be solved well by Go in these areas, but saying that you're "bound to perform well" is an exaggeration.
On the other hand, Rust was meant to build complex solutions such as game engines, database solutions and operating systems because of its high-performing capabilities.
Rust is a very general language, there's little reason why it can't work well in exactly the same areas as is mentioned for Go above.
Having been used by many popular IT giants and other businesses, there is no doubt that Go stands above its competitors.
[Citation needed]
More on reddit.comRust or Go for web development, which to choose?
Can I use Rust and Go in the same project?
Will Rust replace Go?
Videos
Learning about Go can feel like Formula 1 racing, while Rust resembles a marathon. So, what's the catch? I believe anyone eager to learn should not limit themselves to one language, but rather explore both. Here’s why.
Let's assume you are learning Rust. In the initial days, you might feel that the learning curve is very steep, which can be daunting. The Rust compiler acts like a strict father who wants to make you responsible for every step you take, while still providing a layer of safety. This rigorous approach means that for building fast backends, microservices, or any networking application, Rust might seem like overkill due to the verbosity of the code. Meanwhile, Go offers the ability to achieve these tasks with sheer speed, thanks to a robust ecosystem designed for rapid development.
When examining the job market, you'll find that the overall demand for Rust, even in freelancing, is less compared to Go. What's more, there are scarcely any positions for junior or entry-level Rust developers; you're expected to have substantial experience and several Rust projects under your belt before you can secure a job.
On the other hand, let's consider learning Go. What’s the problem with focusing solely on Go? It's straightforward – "easy peasy lemon squeezy." The Go compiler acts as a loving and humble mother, encouraging you to focus solely on your goals while it handles the rest. Go boasts a higher demand than Rust, and you can become proficient and delve deep into it within a few days. However, by not learning Rust, you’re missing out on its burgeoning ecosystem, which is predicted to flourish in the future. Knowing Rust is always a plus point, as it deepens your understanding of how modern software works.
Each language caters to different preferences. If you love building products quickly, choose Go. It's ideal for those who want to develop swiftly and see immediate results. If, on the other hand, you're passionate about constructing products you can swear by, can afford to invest more time, or simply want to appear cool, choose Rust. It offers a sense of mastery and depth, appealing to those who value robustness and detail in their work.
Both technologies have their pros and cons. If you want to move fast, choose Go. If you prefer to prioritize safety, depth, and responsibility, opt for Rust.
Please don’t say too simple answers like « I prefer it’s libraries » « it’s easier » or « it’s enough for me ».
Rust is regarded as a faster and safer language at the cost of productivity / complexity. Is it just that ?
Do you think Go is more a Java/python replacement or can be optimized as well to run very fast (close to Rust/C) ? Maybe is it as fast in I/O which would be the bottleneck in most scenarios ?
I’m doing my first Go program (for GCP) but I’m interested in Rust as well and I’d like pretty detailed opinions from both sides 🙂
(It can ofc be very well « it’s enough for me » btw, everyone has preferences but then some answers could just be a bit pointless if you see what I mean). I’m sure it’s a « yet another go vs rust » question and I apologize 😆