Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's only until you've grokked Rust. I find iterating in Rust to be faster than Python.


Iterating in Python is always faster than iterating in Rust. If you do indeed find what you are saying then you simply speaking aren't able to write Python code.


I thought this too before my current python project.

It doesn't even use type hints and has no tests.

When I look at something I don't know what it is, what it does, and have to debug there (mentally or actually) to even know what's happening. If I change something, a few runtime errors pop up right at the start. Others take 30 minutes.


This may shock you but there is effort involved in learning how to use Python effectively.


What has this to do with my comment?


"Others take 30 minutes"

If you knew what you were doing with Python, you wouldn't have this problem. Obvious solutions include unit tests and pickle.


Unit tests wouldn't help with that, because it doesn't cover the interaction of all the classes when they pass data on to each other; and they would probably take me months;

I would need integration tests, for which I first need to understand how the code works together


"all the classes"

Write simpler code, let go of the complex Java class hierarchies.

No one can understand them, it's hard to reasonable them and they are mostly a mess.

The point of Python duck typing is you do more by writing less code.


Data flows through functions as well... Or between classes that are injected , no hierarchies required; Anyways I can't make wishes about how the code was written


No, because to iterate in Python, you have run the program and get it into the right state. For many things in Rust, I can just use `cargo check`.


From that statement, I'm not convinced you know Python nor Rust.

I'm going to suggest you read the following: https://docs.pytest.org/en/7.3.x/ https://doc.rust-lang.org/rust-by-example/testing/unit_testi...


Are you saying the only quick way to iterate is unit testing? My point is that there's a whole class of things that require unit testing in Python that are just automatically caught in Rust.

If you don't know Rust well, it's going to be slow going. If you've internalized the way it works, it can be very fast to iterate. Especially when you learn to start structuring types in such a way that bad states aren't even representable. You can often make it impossible to construct inputs that would require debugging in Python.

> From that statement, I'm not convinced you know Python nor Rust.

Thanks for the personal attack. I use both Rust and Python regularly at work, and write tests for both. Working on the Rust code base is pretty much always faster, because so many things are caught in advance. Yes, unit tests are still needed, but not for as many things. Learning to use the type system to your advantage, instead of treating it as an obstacle, can really speed things up.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: