Rust is not just beginner unfriendly, rust is also intermediate lvl unfriendly and very hard to read others' code.
But at the same time, I also like it....
Rust is not just beginner unfriendly, rust is also intermediate lvl unfriendly and very hard to read others' code.
But at the same time, I also like it....
Could not agree less. Reading others code is easy as pie in this language. Enforced standards, good automatic comment generation.
It's amazing
Number 4 hit home for me. I've been just trying random shit until it compiles. When it compiles it usually works without understanding what the fuck is going on
Programming rust on an off for 2 years or so
I never used Rust "professionally", I always avoid lifetimes. Borrowing is easy, lifetimes are hell.
- Wtf is the 'de lifetime in serde deserialize??
Aside from 'static
(and the anonymous lifetime '_
), the exact name isn't actually meaningful beyond explaining to the reader what you intend to use this lifetime for.
So, whether you call it 'a
or 'de
or 'database
doesn't change anything about the lifetime itself.
Serde calling it the 'de
lifetime is just to clarify that this is the lifetime of the deserialized object.
Honestly if you never had to deal with more than one lifetime parameter per function and/or type, good for you! As for what 'de is used for in serde — it’s the lifetime of the data you’re deserializing. It’s not really relevant unless you’re deserializing borrowed data, which is very very rarely the case, especially when it comes to web development which I’m guessing you’re most familiar with
Done a lot of embedded work as well, but now mostly webstuff. I think I would prefer the embedded again, web is horrible the more you get to users and browsers, wasm isnt really all that, so many caveats.
Embedded is exhausting with its unsafe and slices everywhere. And whoever wanted most of the HAL traits to be fallible had me spinning in embedded-hal.
Why have the errors when you can't really handle most of them?
But Jesus if probe-rs and the gang att ferrous systems aren't revolutionizing the embedded space. It's amazing. And now the official hal from esp32, it's moving places!
But seriously, I don't have much Rust proficiency and I still pick software in Rust because 1. installing and updating rust itself and things installed with it is a bliss; and 2. the CLI experience of Rust programs tends to be much better than alternatives.
Contrasting that with installing something with Go, which is a common alternative for things written in Rust:
gvm list
works, but to list versions for download it's gvm listall
instead of gvm list --all
)Now for Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh
cargo install cargo-update
to update everything else with cargo install-update -a
:D mostly, there are still a few nice tools written in go that is quite useful, I just hope they will be replaced by rust software soon. Following the iroh project quite closely, I'm guessing someone will rewrite syncthing using that or p2panda soon.
But yeah, the rust Cli tools are just godsent compared to everything else. Ripgrep, fd-files, helix are used daily by me. Started using smartcat recently but I feel dirty knowing that Ollama is actually Go software...
- I actively chose software written in Rust over other software, even if it's not better, and I argue that it is.
Rust has quite a high barrier for entry which is likely to deter inexperienced developers. I'd say that's enough justification to favour software written in Rust.
Python on the other hand is far too easy to get started with, thus the ecosystem is plagued with terrible software. I avoid it like the plague. Yes, there some decent projects written in Python but they are rare things
Oh yeah, not only inexperienced, but uncaring. Python is for people who truly do not care. They want it to "just work" and once it worked once, it's done.
And then they notice it wasn't done, slap some shifty patchwork on top of it. Prince and repeat for a truly masterful piece of spaghetti al dente
Prince and repeat
That should be an album name or something. 🙃
I assume, autocorrect got you, but just in case, it's "rinse and repeat".
I am aware. I even saw it while typing, but it was a typo that made my smile, while offending almost no-one. So I left it there for future smiles :)
How do you feel about Arc<Mutex>? Personally, I just put every variable in an Arc Mutex to make my life easier.
When I need something like that, I usually go with with Arc<RwLock>, from parking lot, I have not ever run into a posioned state that I need to handle.
Otherwise I have been using dashmap. But after having a team that went nuts with it, and it started having it deadlock, which they didn't know how to handle, I am more careful.
OnceCell is also quite useful, it all depends on the situation.
I second RwLock, no need to block on read.