I have an draft article about rewriting where I’ve collected a bunch of quotes, here’s a selection:
In the following interview Joe Armstrong
explains that he often wrote a piece of
code and the next day he threw it away and rewrote it from scratch.
Also in the early days of Erlang it was possible to do a total rewrite of the whole language in
less than a week. New language features were added in one work session, if you
couldn’t get the idea out of your brain and code it up in that time then you
didn’t do it, Joe explained (17:10).
“We need to break systems down into small understandable components with
message passing between them and with contracts describing whats going on
between them so we can understand them, otherwise we just won’t be able to
make software that works. I think the limit of human understandability is
something like 128KB of code in any language. So we really need to box things
down into small units of computation and formally verify them and the
protocols in particular.”
I found the 128KB interesting. It reminds me of Forth here you are forced to fit your code in blocks (1024 chars or 16 lines on 64 characters).
Speaking of Forth, Chuck Moore also appears to be a rewriter. He said
something in similar:
“Instead of being rewritten, software has features added. And becomes more
complex. So complex that no one dares change it, or improve it, for fear of
unintended consequences. But adding to it seems relatively safe. We need
dedicated programmers who commit their careers to single applications.
Rewriting them over and over until they’re perfect.” (2009)
Chuck reimplemented the his Forth many times, in fact Forth’s design seems to be centered around being
easily reimplementable on new hardware (this was back when new CPUs had new
instruction sets). Another example is Chuck’s OKAD,
VLSI design tools,
to which he comments:
“I’ve spent more time with it that any other; have re-written it multiple
times; and carried it to a satisfying level of maturity.”
Something I’m curious about is: what would tools and processes that encourage rewriting look like? The post mentions that it somehow is related to the Extreme Programming movement, but doesn’t give a precise reference…
what would tools and processes that encourage rewriting look like
I’ve been doing this on a micro level with PRs. I wrote it once for me, then again (usually in another branch) for the reviewer so the commits are small and make more sequential sense. Usually I’m surprised that I’m able to make improvements and produce a better outcome. Sometimes I find bugs I didn’t notice the first time around.
It helps that it’s in Rust so strong types and lint tools etc. give me lots of confidence in refactors. It takes more time, but reduces review length and improves the outcome so it’s a net win IMHO.
It’s not for every team and every situation, but it’s a good tool to have in the toolbox.
I came to the comments to mention the time Joe Armstrong had mentioned this technique to me in the hallway at an Erlang conference when I asked him about how he approaches productivity, and how unnatural it initially felt, but over time I’ve tried applying it to more things, including a bunch of the projects that ended up in the komora github project. I’m so happy to see the videos you linked, since I never was able to find anything he wrote about it.
When I’ve had the luxury of having enough time to comfortably apply this technique, it has really resulted in some nicely modular components, since you’re forced to break things down into pieces that you can reasonably attempt in a day. But over time, you can build these simple modules into more and more interesting, well-decomposed complex systems.
I have an draft article about rewriting where I’ve collected a bunch of quotes, here’s a selection:
In the following interview Joe Armstrong explains that he often wrote a piece of code and the next day he threw it away and rewrote it from scratch.
Also in the early days of Erlang it was possible to do a total rewrite of the whole language in less than a week. New language features were added in one work session, if you couldn’t get the idea out of your brain and code it up in that time then you didn’t do it, Joe explained (17:10).
In a later talk he elaborated saying:
I found the 128KB interesting. It reminds me of Forth here you are forced to fit your code in blocks (1024 chars or 16 lines on 64 characters).
Speaking of Forth, Chuck Moore also appears to be a rewriter. He said something in similar:
Chuck reimplemented the his Forth many times, in fact Forth’s design seems to be centered around being easily reimplementable on new hardware (this was back when new CPUs had new instruction sets). Another example is Chuck’s OKAD, VLSI design tools, to which he comments:
Something I’m curious about is: what would tools and processes that encourage rewriting look like? The post mentions that it somehow is related to the Extreme Programming movement, but doesn’t give a precise reference…
I’ve been doing this on a micro level with PRs. I wrote it once for me, then again (usually in another branch) for the reviewer so the commits are small and make more sequential sense. Usually I’m surprised that I’m able to make improvements and produce a better outcome. Sometimes I find bugs I didn’t notice the first time around.
It helps that it’s in Rust so strong types and lint tools etc. give me lots of confidence in refactors. It takes more time, but reduces review length and improves the outcome so it’s a net win IMHO.
It’s not for every team and every situation, but it’s a good tool to have in the toolbox.
I came to the comments to mention the time Joe Armstrong had mentioned this technique to me in the hallway at an Erlang conference when I asked him about how he approaches productivity, and how unnatural it initially felt, but over time I’ve tried applying it to more things, including a bunch of the projects that ended up in the komora github project. I’m so happy to see the videos you linked, since I never was able to find anything he wrote about it.
When I’ve had the luxury of having enough time to comfortably apply this technique, it has really resulted in some nicely modular components, since you’re forced to break things down into pieces that you can reasonably attempt in a day. But over time, you can build these simple modules into more and more interesting, well-decomposed complex systems.