Hacker News new | ask | show | jobs
by atoav 2750 days ago
> with how if you can get something to compile it is substantially more likely to work

That is what expected the least, when I was starting out. I was looking for something that is a little like Python, but faster than it. It gives me a sense of security to see the compiler call me out for a reason, telling me exactly which cases I forgot. Together with the type system I often find myself in situation where I do something quite complicated (for my experience) and then I am at a point where I am confident it works, I `cargo run` the whole thing and it works like a charm.

In Python a lot of things would run, but also broken things. Having it run was no guarantee at all it won't end up in a convoluted traceback later. In Rust having it run is a great part of the deal, I rarely encountered Panics afterwards, and when I encountered them it was me willfully defining where I would encounter them.

The weird thing is: because it takes much more to just get a program that compiles – even if you're lazy you end up with a higher code quality. It won't let you take some shortcuts that will haunt you later and that is a good thing.

1 comments

I also find that Rust drives me to document more - because when I do something "intuitively" that doesn't work and then spend an hour refactoring until it does work I usually leave a comment about it.

And those are almost always the good "in depth" reasoning comments you want in software, not the mandatory "Function save saves the file to where parameter location is" which just repeats the definition.

I still love Python, but I can't even argue its a productivity win for me to use over Rust anymore, because while I might sometimes make something that seems to work faster the lack of confidence makes scaling the program much harder and there really is nothing syntactically in Rust besides the static typing (which is a good thing in my book anyway, its why Python added function signature type hints after all) and verbosity (semicolons, mandatory braces, etc) that prevents you from writing code as fast as a Python variant with the right library support.

"with the right library support"

Well that's the thing it's all about libraries, and now in Rust it's nowhere compare to Python for the web dev.