I have been programming in Rust for about 8 years now. I love the language. But I feel I have some confessions I must make.
-
I don’t know if I use tabs or spaces in my final code. I just assume that it all get solved correctly by cargo fmt. I don’t even understand that people have been arguing about this for real? I vaguely remember this being important in C and C++, but I am hoping I never go back to those dark days.
-
I never do linebreaks, not even when adding my semicolons. I hit “:w” and if shit doesn’t move around on my screen, I fucked up somewhere.
-
The only lifetime I ever use is '_, 'a or 'static otherwise I give up
-
Wtf is the 'de lifetime in serde deserialize??
-
Rocket is the best web server
-
I actively chose software written in Rust over other software, even if it’s not better, and I argue that it is.
Okay, got that of my chest. Never dared telling anyone this before. Feels scary
- 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
'aor'deor'databasedoesn’t change anything about the lifetime itself.
Serde calling it the'delifetime is just to clarify that this is the lifetime of the deserialized object.For #4: the
'delifetime is the lifetime of the deserializer (and input data). It’s used to allow you to deserialize the data into a type without copying it, like deserializing a&'a [u8]buffer into a&'a str. It’s documented here if you want to read more.- 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 :)
It gave me a smile :)
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…
deleted by creator
Could not agree less. Reading others code is easy as pie in this language. Enforced standards, good automatic comment generation.
It’s amazing
It also has the best learning resources I’ve ever found for a programing language, which are free BTW.
I’ve tried to found a Python course for a friend (paid or not), and I couldn’t find anything that looked close to the quality of the Rust book. Some paid online courses have to be awesome but they are all paywalled before the first relevant chapter 🤷
I never used Rust “professionally”, I always avoid lifetimes. Borrowing is easy, lifetimes are hell.
Hell? I don’t see what you mean, that’s a fairly simple concept!
https://doc.rust-lang.org/nomicon/subtyping.html#variance 🫣🔥🔥🔥 (the table in this section sometimes haunts me in my dreams)
Didn’t know this, loved this warning:
THE KNOWLEDGE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF UNLEASHING INDESCRIBABLE HORRORS THAT SHATTER YOUR PSYCHE AND SET YOUR MIND ADRIFT IN THE UNKNOWABLY INFINITE COSMOS.


