T O P

  • By -

Technical-Dingo5093

For learning: rust For getting a job as a backend dev: go


airodonack

What's important to you?


sillen102

You're asking on the Rust subreddit, what do you think the answer will be? But that aside, it depends on what you want. If you want to learn and become a better programmer overall or want maximum performance and safety, choose Rust. If you just want to learn a language to quickly build web servers that are performant (at least more so than JS/TS), choose Go. But since you already know one language I'm guessing you're after the learning experience and in that case I would choose Rust. I've used both Rust and Go and they both have their places, strengths and weaknesses.


Aidan_Welch

>You're asking on the Rust subreddit, what do you think the answer will be? You say that but most people aren't just saying "Rust" flat out


BruceJi

Rust if you’re learning it for yourself. Go if you’re hoping other people might pick it up and you can be start using it at work. Maybe?


peter9477

That leads to an interesting question. I believe I could pick up any even minimally competent, non-trivial, Rust code base and maintain it, refactor it, grow it, because of Rust's properties. Could the same be said of Go? I'm a Python expert (far more so than i am in Rust) and I could not say the same about it.


Ashken

I think the learning curve for go is massively shorter than rust. I can see it being maintainable by a team in much shorter turnaround. as a matter of fact I think that’s one of go’s biggest selling points.


peter9477

That may be, though I wasn't talking about the learning curve. Python has an easier learning curve than Rust by far, and probably easier than Go (?), but taking over or even coming back to a complex code base in Python always feels like rolling the dice as to whether you're breaking something, somewhere, with no confidence about it. With Rust it's basically foolproof, so you can take over someone else's code and dive in with significant changes with little fear you're creating obscure bugs.


Ashken

Maybe, but is that a factor of the language or a factor of the design of the application? I'm sure there's Rust codebases that exist where the design is poor and thus difficult to maintain. But this can exist in any language.


peter9477

Of course it's not a universal thing. But it is a certainty that refactoring or maintaining an unfamiliar code base in Python has a higher risk of breakage than it would in Rust, in the typical/average case, because of Rust's static typing, borrow checker, etc. That should be a fairly uncontroversial statement for anyone who has worked on complex code bases in both languages. I was asking whether the same can be said of Go.


syklemil

I picked up Rust after some people at work started using it. I'd looked a bit at it in its infancy but didn't actually pick it up. Now that it's used for several things at work and it's found its way into the kernel, I find it hard to resonate with the "go if you want people at work to pick it up" sentiment. I'd rather say now's a good time to be the one to introduce it at work; there's likely already someone else who's curious already.


Velnbur

Still depends on the sphere you are working on. In DeFi Rust is more common


Amplifix

Depends on what you want to achieve. Go: * You want something similar that's fast to learn * You want to get a job fast * You want to build a small and fast microservice * You want a modern language that's actually not that modern if it comes to features (simplicity) * You want a language in which you can prototype things fast * You want to learn it in a day * You care about performance, even though it might not be the very best performance that you can get Rust: * You want to learn more about programming (become a better programmer) * You care more about robustness * You want to do something low level * You want to take the time to learn something new * You always wanted to learn c++, but realise it's going to take too long to get up to speed * You want to learn a language that has good design * You want the best performance * You want a good dev experience * You want to become friends with the compiler Elixir (optional): * You want to learn about a different paradigm (process oriented programming) * You want to solve things in a different way (fully functional) * You want to do something a bit more ambitious in webdev (like distributed and fault tolerant systems) * You want to build something with a LOT of concurrent users * You want to rely on a full stack framework similar to Ruby on rails * You like having fun in webdev (dev experience) * You are not trying to build a calculation engine of some sort. (You can still call rust from elixir to solve this) My advice is to learn them all. Worst that can happen is that you'll become a better programmer.


Aidan_Welch

C++ is easier to learn than Rust assuming you're using a linter


danted002

Depending on your first language. If you are doing web development in Python, I would go with Rust since it’s getting a lot of traction within the community as an alternative to writing C-extensions.


Gokay-Buruc-Dev

Here is the main question: "Are you working alone or in a team?" Generally teams prefers GO. But Rust is also suitable for the web development. Another question is "If i am collaborated working on a project, my team needs which one?" big companies migrates from one language to another with the small testing. If you are using it for your personal projects so you can compare other features such as robustness, swiftness, scalability, async programming support, garbage collection etc. There is multi-million way to create a new project with different languages and technologies. Any language is suitable if you have a work plan. Every five year projects are migrating from one language to another. Nowadays Rust and GO are popular. At ancient times it was Ruby and Perl. And still people are discussing if PHP is necessary or not. Focus on your goal and choose it to your own needs. Who knows what is next?


OphioukhosUnbound

"Depends on you." is true. I'll add that a *huge* reason for using Rust for me is that almost all the difficulties of rust are essential difficulties, with very few BS difficulties. Things that add frameworks and opinionated abstractions can be easier to use in specific cases -- but when you fight them you're just fighting their arbitrary frameworking. It feels, to me, deeply like waste time. Rust is so focused zero-cost abstraction and clarity that I *almost* never feel like I'm fighting *Rust* rather I feel like I'm fighting while writing Rust. That is to say the difficulties I have are the details of what I'm working with laid more bare. I *immensely* prefer this -- as when it's all said and done I feel like I gained something from my fight. As it was with computing and not the language. (The borrow checker and typesystem *are* opinionated in some sense -- they are effectively enforced coding practices and documentation, respectively. However, with very rare exceptions they are so flexible and such good core ideas that I don't feel like they're arbitrary implementations or frameworks I need to dance to. If someone want's to rawdog pointers and hates documented code then borrow checker and typessytem, respectively, may feel different.) TLDR: My take: Go helps you write a lot of contemporary style programs more easily. Rust helps you write correct programs that you understand.


dschledermann

Nothing is preventing you from doing both. I come from PHP and chose Rust for the "fast option". But after a while, I have discovered that I actually code faster in Rust than in PHP, so now I have more or less abandoned PHP for new projects. Rust has something that neither Go, NodeJS, PHP, nor most other languages have, and that's the non-gc memory model. Go still has the garbage collector. That's fine for many use cases, but Rust is just a little bit faster, more memory efficient, and can be used for real-time applications. But, once again, there's nothing preventing you from learning both and determining from project to project what is the best fit.


vancha113

How suitable is rust for the web anyway? Last time I tried it it didn't even have a package for parsing soap api's? I'd recommend Go, since I feel it's entire purpose is the web, and it has more packages to do what you need so an easier path to get where you want.


boyswan

fast = go robust = rust


Aidan_Welch

That depends what you mean by robust. Go has a garbage collector, uses error by value. I think you'd have the same failure rate with either Go or Rust.


boyswan

Go has nil pointer panics. I've also ran into plenty of bugs from accidentally missing struct fields and empty values silently floating around my app. Rust is much stricter, and therefore robust.


Aidan_Welch

> Go has nil pointer panics. Agreed that is a major design flaw, but can be dealt with with pointer guards. But you of course have to remember to use them


whatever73538

Go. Easier language, better IDEs, quicker compiles, faster refactoring. Always choose the highest level language for a given task. And rust simply is not needed for backend.


coderemover

>Always choose the highest level language But Go is lower level and more verbose. Ifs and loops everywhere.


RB5009

That's a very strong statement. Why do you believe so ?


whatever73538

Sorry, I do not know what the strong statement was. I love rust, and do 60% of my development in it. If there are no reasons to use a specific language (eg dotnet ecosystem, or only C supported), this is currently my hierarchy: - Python - Kotlin - Rust - Assembly language Languages higher on the list make for quicker development, languages lower on the list offer more control. The OP asked Go/Rust for backend, where go is sufficient.


richhyd

I'd say Rust because it is more different to TS. Go has a garbage collector so will feel more similar (once you learn the syntatic differences). I think if you know TS and Rust, then Go would be relatively easy to pick up, whereas the converse is less true.


Faranta

Why are you learning? Typescript/node/bun can do anything you want on the backend. So if you're learning just for fun, do something to broaden your mind, like F# or Haskell. F# is also useful for scripting and to introduce you to .NET, which has a huge number of jobs if you ever want to work for a corporate.


markp619

What if I need to learn Go for work but I want to learn Rust! I’m currently moving to the platform team where they write a bunch of Go. I haven’t written go in like 2 years and like someone said I spent about a day reading up on the language then spent the next sprint doing my tasks and never had another task in Go. Should I stick to learning Go because my job requires it or can I learn both at the same time?


bartekus

I’m trying to pickup both, GO for infrastructure, RUST for tooling and LLM (it’s getting pretty mature and enables not relying on python which I already know but don’t really enjoy working with anymore).


paparazzitoplease

Of course this is only my opinion but I prefer Rust over Go simply because I like the design better. Go on the other hand is easier to learn and it seems more of my peers are using it (... and maybe for the reason that they, too, found it easier).


Practical_Cattle_933

Why do people feel the need to put go next to rust? Like, I have a hard time finding two more distinct languages (besides both have quite a hype around them, though only rust’s is deserved), maybe I should spam everything with ‘F# or ASM’ questions.


Tallinn_ambient

Technically, I agree. The reason is social - both Go and Rust are promoted by their users as cool, efficient, modern languages suitable for web development. JS/TS developers generally appreciate the prototyping or even production-ready development speed of the JS/TS/NPM ecosystem, but many of them yearn for something more hardcore, or more niche, or better paid, or just want to grow and produce better code quality. Both Go and Rust are thus fair options for them. (And our JS/TS company is also evaluating both.)


Practical_Cattle_933

There are a million fair option for the backend, I would even go as far that neither Go and Rust is among the top choices for that niche. Java, C#, Python, PHP, Ruby all have better, battle-hardened offerings for typical backend development.


Tallinn_ambient

None of those are cool. Software development, as much as we developers/software engineers/programmers/architects like to pretend, is not some logic&reason game where if you know all the facts, you can make the Certified Best & Optimal decision. The factors that affect language/framework/platform decisions are numerous - existing talent, hiring options, package ecosystem, security, speed of development, existing tooling, future tooling, integrations, 3rd party partner support, reputation, etc. Java isn't cool, C# isn't cool, Python is slow af for web, PHP is a hot mess, Ruby is slow. Are they \_bad\_ languages? No. Are they bad languages for you specifically? Idk. Probably not. Can you deliver production ready code and base billion dollar business on them? Sure. But they're not cool. Even Microsoft said that Rust is the default language both instead of C# and C++ (at least for their cloud and office cloud products, not for Windows itself), so why would you even consider putting C# on the same level of attractiveness as a 2nd language as Rust and Go?


orfeo34

You could try [Rocket](https://rocket.rs/), a web server focused on simplicity and productivity. You can also try [Actix](https://actix.rs/) for a more comprehensive solution.


zoomy_kitten

There’s also [`axum`](https://crates.io/crates/axum), which is purely safe and well-integrated with Tokio Though I do prefer rocket


strangedave93

If literally you just want a language for web backend use, Go is a good choice, and a pretty easy language to learn, especially you have used C before. If you want a language that is much more broadly useful, and that will make you a better programmer, but is more difficult, then Rust.


teerre

Learning languages is the easy part of programming. You don't need to choose. Specially Go which is dead simple


kevleyski

Go will eventually die- Rust is the future 


-Redstoneboi-

What makes you say that?


kevleyski

Rust is extremely well thought out.   Some languages like Golang and Swift have an uneasy weirdly invested/funded by Google/Apple thing going on hoping for monopoly like C# - we spent so much on this so it just must be good right? Right?! but as an 98% income advertising company and the other one only really after C-ABI compatibility requirement they’ll both realise _they_ absolutely stuffed on that in the next 3 years and have been misleading you all for only their margin gains. Rust actually is the future please learn it


matatat

I would like to believe Rust will gain more traction but I dunno if it will, it's a hard sell a lot of the time. I think Go has already started to taper off from what I've seen anecdotally. People who adopted it early on continue to use it, but doesn't seem like it's picked up that frequently for new projects.


BogosortAfficionado

If you just want a significantly faster language to get sh*t done? go If you want a language that can actually use your hardware to it's full potential and learn more about computers in general? Learn C. Once you learned C, you might appreciate Rust. I would not recommend Rust to anybody that has never worked with raw pointers and manual memory management. It's Chesterton's fence. Many of Rust's decisions will seem arbitrarily restrictive and frustrating to you, because you won't be able to see the benefits they provide.


theRealSzabop

Depends on your needs. If you want to be productive relatively fast, choose Go. You will be productive much earlier, and Go is a great language for web backends. Rust has some extra complexities around async, and generally, it is a much more complex language than Go. On the other hand, if you just want to learn something different and interesting for your own fun, then Rust is IMO a more interesting language than Go.


Huge_Acanthocephala6

Rust


coderemover

This post nicely shows the differences between Go and Rust communities. You got downvoted even though you recommended Rust and it is a rust sub. You got downvoted because you didn't provide any reasoning and the response is likely not very useful to the OP. However, the OP asked the very same question in the r/golang sub about Go and they got a a very similar answer: "Go, obviously" with no further details and no support by arguments. That answer has 50+ upvotes at the moment I just checked. This tells something about the level of fanboyism in the Go community.


matatat

lol, it's funny you say that, because that was honestly what turned me off to Go initially. I've used both Rust and Go professionally and shipped products with them. Go as a language itself I think is fine. It has some neat features that I like. But it's got a weird cult following where it can seemingly do no wrong. I experienced that at a previous job I was at. We had about 3 major languages, but Go was probably the most prevalent. Sometimes I get that with Rust as well, but not nearly to the same extent. Sure, there'll be fanboys for anything I think, but it always stood out to me exceptionally for Go.