←back to thread

517 points bkolobara | 3 comments | | HN request time: 0.37s | source
1. CupricTea ◴[] No.45055045[source]
Fearless refactoring is THE reason I rewrote an internal tool at work from Python to Rust. When the code got sufficiently large and a refactor was in order, I suddenly realized how loose everything is semantically tied together. I understood why so many Python developers like writing so many dumb unit tests. They're compensating for the lack of a strong static type system[1].

This is an internal tool that isn't our main product so I don't see any value in spending extra time writing needless long-winded "did the user pass the right thing" tests or getting a static analyzer going so I just chose a language with as little build system/static analyzer/built-in unit testing/separate runtime installation headaches as possible to get things going easier.

That was three years ago and the tool is about 4x more featureful than when it started.

[1]: https://dmerej.info/blog/post/i-dont-need-types/

replies(1): >>45055067 #
2. api ◴[] No.45055067[source]
Refactoring is a huge problem for all dynamic languages. It’s so easy to break things in ways that do not appear until runtime.

They are very productive for first drafts. Then the code tends to “melt” as more people work on it or you do refactors because there is no static type system to catch obvious problems or enforce any order.

replies(1): >>45055348 #
3. CupricTea ◴[] No.45055348[source]
I definitely agree with first drafts. To this day I still fire up Python for quick ideas and one-off scripts because it's just so damn convenient. It wasn't until I tried writing larger programs in it where I first felt how brittle it really is.