4 ms·
Rust is great but it could gain from explaining itself with memory and pointers or else why a String has the Clone trait and a u32 the Copy trait? I tried to le
by cassepipe 6y ago
Rust is great but it could gain from explaining itself with memory and pointers or else why a String has the Clone trait and a u32 the Copy trait? I tried to learn it as a first language and it was hard until I started learning C, groking the stack the heap and pointers. I think all the tutorials out there are ill suited since they hide away so much. It's harder to remember stuff if you don't understand why it is that way, well at least it stands true for me. So I would love to see a Rust for beginners tutorial for C beginners. Maybe I'll write it someday. I really got discouraged when it got into the ugly lifetime syntax. But I will definitely come back to it. (Unless Zig shows to be just as safe and less verbose)
- ssokolow 6y agoFair point. The Copy on u32 and lack of Copy on String is confusing until you've grasped that things containing heap allocations are ineligible for Copy, and that Copy is primarily intended for data types the same size as or smaller than a pointer.