1/8 My code style is getting simpler with every passing year.
Things I used to be into:
• Functional Programming (category theory etc)
• FRP (first and higher order)
• Domain specific languages
• Proper OOP (Smalltalk etc)
...
Today I barely use anything from the list.
2/8 Most of what I write today is basically "procedural + immutability". Every module has a few public functions. Each public function receives and returns immutable data.
3/8 Within each module it's OK to mutate. Local mutability helps write concise, easy to understand, fast code.
I used to write nested reduces and feel good about myself--no more.
4/8 Of course local mutability isn't sufficient, so I have a few places at the top where global mutation happens.
Classes are OK as long as they are used as modules, not instantiated in random places.
5/8 I'm also much more selective at using abstraction. I realized how costly it is: abstraction often creates indirection, which makes code harder to understand. So if you abstract, it's better be worth it.
6/8 DSLs, in almost all cases, are unnecessary abstractions. Imo 9 times out of 10 they hide bad design.
7/8 As many engineers I used to like being clever.
"My whole solution is a 3 line data transformation pipeline using 10 types of unnamed tuples."
8/8 FP, FRP, DSL, ... there is something to learn from each of them. But somehow I arrived at the code style that looks like something from 30 years ago :)
It's boring.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
(1/12) My work, to a large degree, is about examining ideas, building mental models, and finding connections between things. This is probably true about most senior software devs. Let me share some of my observations.
(2/12) Tools like ROAM/Obsidian/Craft don't help **me** create knowledge. They are good at linking documents together, which helps me remember a lot of detailed stuff. But that's not knowledge creation, it's just remembering. And I think "remembering" is overrated.
(3/12) My knowledge construction process consists of Capture -> Review -> Revise -> Compact.
(1/9) On task and project management, habits, focus, tools.
(2/9) I don't start with projects or tasks. I start with notes and documentations. Actionable emerges from non-actionable. (This of course applies to new stuff, not to the current list of things you have).
(3/9) Pull (like in personal kanban) works better than push (like in GTD). I feel less overwhelmed, and more focused this way. It helps me curate what is on my plate.
(1/13) Why startups loved Rails, why build tools matter, "thesis–antithesis–synthesis", and why should use Nx for your React and Node apps.
(2/13) Ruby on Rails was huge in the startup world because it let you build amazing things in weeks (instead of months or years). Although often we focus on the framework part of Rails, a lot of the value was in the build tool.
(3/13) When using Rails we didn't have to worry about setting up the DB, setting up the server, setting up tests, splitting dev and prod etc. It all worked. No iteration 0.