5 ms·
I've been coding professionally in Go and have recently switched largely to Rust. I feel Go is designed for junior developers: it's easy to get started, like wi
by herdcall 4y ago
I've been coding professionally in Go and have recently switched largely to Rust. I feel Go is designed for junior developers: it's easy to get started, like with Python, but comes at the cost of verbosity and lack of expressiveness. E.g., you'll have to live with "if err != nil" all over the place. It's good for orgs though because code written by different people looks the same and readable. Most importantly, it's garbage collected, which can be good or bad depending on where you're using it (good because you can be super cavalier with memory, but bad because of stop-the-world pauses).
Rust IMO is much more advanced and expressive. It's a joy to write, makes you think and feel like a developer rather than an assembler that you can feel with Go. IMO it handles most of the common problems with languages well and has probably the best support for Web Assembly if that's your goal. It's not garbage collected, which is critical for systems programming. It is more complex than Go though and takes longer to master. Also, while it's growing rapidly, Rust also has fewer job openings compared to Go, if you're doing this for getting a job.
- canucklady 4y agoI think there's two ways people view programming: it's either a means to an end, or it's a fun pizzle trap. Personally I only care about getting the job done in the cheapest and most reliable way possible. There's lots of interesting problems when you think about the dynamics of distributed systems, improving developer velocity, etc. Trying to code golf a single method just isn't appealing to me, so I don't mind slapping together some Go and a good set of tests and calling it a day.
- dimgl 4y agoWhat is it with people who love Rust? If a language is not an absolute behemoth, it's a kid's language. Do you feel the same way about Lua? Like, this notion is wild to me. > Rust IMO is much more advanced and expressive. It's a joy to write It can be argued that in a professional setting, this isn't what a business cares about. Businesses care about getting stuff done, not whether you like to write your code and your language is "expressive". They want boring. Boring is good.
- rob74 4y ago> Rust IMO is much more advanced and expressive. It's a joy to write [...] Maybe, but is it also a joy to read?
- enneff 4y agoSeriously. I think Rust has a lot going for it, but I will say this: the type inference in Rust combined with its expressive type system can make sophisticated programs very hard to follow. My experience was with extensively reading the cargo codebase; trying to figure out what the resulting type of an expression that maps/filters/collects over other complex expressions is a chore. For example, I find it very hard to figure out what the type of public_dependencies is in this declaration: https://github.com/rust-lang/cargo/blob/8fbc8459d59f3acecdb6132fe6f4f2c0b3edbc47/src/cargo/core/resolver/resolve.rs#L97 https://github.com/rust-lang/cargo/blob/8fbc8459d59f3acecdb6... This is the same kind of thing that makes JavaScript challenging to read. It requires a lot of discipline on the author’s part to make it clear what is going on, and even the best of us lack discipline at scale.
- Gwypaas 4y agoSimply looking at the Resolve struct definition tells you. /// A map from packages to a set of their public dependencies public_dependencies: HashMap<PackageId, HashSet<PackageId>>, I do agree with you that Rust is easier to read in an IDE though, since then those types gets autoresolved and hinted inline for you.
- enneff 4y ago> bad because of stop-the-world pauses Have you actually experienced this to be a problem in the last half decade with Go? GC pauses in modern Go programs are short enough to be negligible in almost any practical program.