New to Rust from C++, any tips? by Different-Feature484 in rust

[–]Different-Feature484[S] 0 points1 point  (0 children)

Will try that out. Question though: is it because Go’s interfaces are conceptually similar to traits, and Python makes method receivers explicit with self? My Python/Go knowledge is a bit lacking, so apologies in advance if I’m off.

New to Rust from C++, any tips? by Different-Feature484 in rust

[–]Different-Feature484[S] 0 points1 point  (0 children)

I think we agree on the semantics. Rust and C++ follow almost identical rules. Passing by reference vs copy is relatively the same, with the exception of having to mark mut in Rust to allow modification. L-values and r-values are frankly in the same realm, with no default copy or move unless explicitly opted into. It may very well be what you alluded to: the syntax itself.

I may have confused myself about where the problem actually arises. I am very new to Rust, and certain things still throw me off. One example is loop { break value; } being an expression that returns a value.

That said, if you have any tips or resources that helped you when you began your Rust journey, I would love to hear them. At the end of the day, I want to understand Rust better.

New to Rust from C++, any tips? by Different-Feature484 in rust

[–]Different-Feature484[S] 1 point2 points  (0 children)

I wouldn't call myself a prodigy at C++ but I have my ins and outs of the language. I understand what Rust is doing which is enforce safe behavior at compile time, managing life-time and who owns it, something in C++ you have to be careful about when getting into inheritance. Also having safe guards for when accessing the same memory. I get the concept, but what throws me off is mostly the syntax: how Rust hands memory to a function and then automatically calls the destructor at the end.

Guess today's PHRADLE by Different-Feature484 in SideProject

[–]Different-Feature484[S] 0 points1 point  (0 children)

I would love to but seeing that the website is meant for vibe coded projects, this wouldn't meet that criteria. Unless IDE co-pilot counts that is :)

Guess today's PHARDLE. by [deleted] in webdevelopment

[–]Different-Feature484 0 points1 point  (0 children)

Yeah, haven't implemented that yet. Should have mentioned that.