WTF I didn't understand, thanks for the explanation. The fact that it's used all around the world in big companies doesn't matter I guess.
What the actual fuck. It's a made up story I'm sure.
It's a toy example. In that case, the solution is to assign the expression to a variable to compute its result upfront.
There are still obvious things the BC cannot get. For example:
struct Foo;
impl Foo {
fn num(&mut self) -> usize { 0 }
fn index(&mut self, _i: usize) { }
}
let foo = Foo;
foo.index(foo.num()); //error
It's like someone has pooped on my screen.
My coworkers do document the code:
/// Returns a list of foos, given a bar.
fn get_foos_from_bar(bar: Bar)
Funny, I think C++ is literally the worst language to learn programming. I would go with JS or OCaml at first, then Rust if they need manual memory management.
In my company, we use zenhub on top of github, but I'm not sure it's worth it.
I'd argue the macros are quite bad:
- Declarative macros are hard to read, same level as regex
- Procedural macros require to write a new crate with a ton of boilerplate, sometimes for stuff conceptually really simple (like hash is: apply the same function to every field, then compose the results)
I agree, though, that it's better there're here than nothing. It's just that there is to be a better solution.
Sorry for the late answer. Those days, I'm interested in Ante. The language creator has some novel ideas for a non-GC memory safe language. And the compiler is written in Rust. It's not finished at all tho.
As said my sibling comment, I use KDE connect with GNOME shell
We can go further, I think it's impossible to prevent memory leaks in a general purpose language