3 ms·
When I use Python I miss Rust's enums, the pattern matching of those enums, and the static types that help refactoring (the compiler spots where one change has
by kzrdude 9y ago
When I use Python I miss Rust's enums, the pattern matching of those enums, and the static types that help refactoring (the compiler spots where one change has knock-on effects in the rest of the project..).
Especially how Rust enums and structs make it easy to define new types to guide your programs are a highlight for me.
I don't think Rust is better than Python for every task. Python is a lot simpler if you can get something done with its built in types (dicts, sets and lists). Python's dynamic types are also a great benefit for some tasks, where Rust's dynamic dispatch support is very limiting.
Crazily, handling dependencies and building a project is way easier in pure-Rust than pure-Python since it's standardized.
- Rotareti 9y ago> Especially how Rust enums and structs make it easy to define new types to guide your programs are a highlight for me. In recent versions Python got some nice improvements in this area, with the new way of creating NamedTuples, Data Classes and the typing module. I wrote a stackoverflow answer recently that sums it up, if anyone is interested: https://stackoverflow.com/a/45426493/1612318 https://stackoverflow.com/a/45426493/1612318
- akmittal 9y agoGo is good middle ground between simplicity and being fast/dynamic.
- kod 9y agoWalk middle, sooner or later get the squish just like grape.
- SanFranManDan 9y ago> Avoiding both these extremes, the Tathagata (the Perfect One) has realized the Middle Path; it gives vision, gives knowledge, and leads to calm, to insight, to enlightenment and to Nibbana.
- kod 9y agoBut I bet Mr. Miyagi could beat up your Tathagata in a coding contest.