3 ms·
With rust you have to specify type, usually a container/reference type, and annotate lifetimes of everything you pass around. You literally do none of that in P
by jasmer 4y ago
With rust you have to specify type, usually a container/reference type, and annotate lifetimes of everything you pass around. You literally do none of that in Python. You don't even declare variables. They are totally on the opposite ends of 'strictness'.
- shpongled 4y agoFor rapid prototyping I (who you originally replied to) completely avoid lifetimes. If you think you have to "annotate lifetimes of everything you pass around", you should probably revisit Rust. This is simply not true. I find type annotations to be a major benefit while prototyping - I know exactly what everything is, and can quickly refactor anything. The ability to use serde to deserialize/serialize into Rust structs is another huge benefit. Chaining iterators, collections, etc removes a lot of the boilerplate that I find myself doing in python. I've also been using Rust as my primary programming language for 5+ years now, so I am definitely "in the zone"