People often imagine that quick-and-dirty code is better in an untyped language. I think that's true for the first day or so. But if a team is sprinting to get something done over even a few days, a good type system is an accelerant.
-
Show this thread
-
And once you want to start paying down that technical debt, the refactoring power of types pays off massively.
3 replies 10 retweets 64 likesShow this thread -
Replying to @yminsky
I’ll admit I’ve never used an advanced type system at organizational scale, but my experience has been that types often inhibit refactoring as much as they help ensure you don’t make a trivial class of mistakes.
1 reply 0 retweets 1 like -
Replying to @BrandonBloom @yminsky
I’ve done my fair share of refactor-by-error-list and I much prefer refactor by file-search-list. The latter always shrinks & doesn’t randomly get rearranged as you fix issues.
3 replies 0 retweets 1 like -
Replying to @BrandonBloom @yminsky
volatility of errors list and the all-or-nothing consistency barrier of static typings often means refactoring has an indefinite duration. Makes a cost/benefit tradeoff hard. Often have to abort refactors due to growing cost estimates. Still true with test suites, but less so
2 replies 0 retweets 0 likes -
Replying to @BrandonBloom
I just haven't seen this high barrier you describe. It's usually small and cheap. And anyway, you often have a good guess as to the refactor size, and if it turns out to be bigger than you imagine, you abandon ship and rethink your choices.
2 replies 1 retweet 3 likes -
Replying to @yminsky @BrandonBloom
My experience with refactoring in OCaml, Java, Python, Lisp, Scheme is that you need *tooling* to help you or you'll waste a lot of time, but that static types are one kind of tool, but there are others, such as IDE tools, cheap interactive debuggers, etc.
1 reply 1 retweet 1 like -
That said, one of my best recent refactoring experiences was translating a small library from Python to OCaml, refactoring in OCaml thanks to the static typer tracking conventions for me, then retranslating to Python.
1 reply 0 retweets 3 likes -
Replying to @Ngnghm @BrandonBloom
Why did you translate back to Python at the end?
1 reply 0 retweets 0 likes -
Replying to @yminsky @BrandonBloom
The deliverable had to be in Python. Certainly not my choice.
1 reply 0 retweets 0 likes
Unhappily, not every employer or customer is willing to let me choose my programming language for deliverable, and I have to integrate my code with existing code bases. OCaml is unhappily a hard sale — thank you for making it less so.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Read my blog!