, 14 tweets, 7 min read
My talk from @jscamp, "The Return of 'Write Less, Do More'" is up on YouTube:

It's a 30 min talk on @sveltejs, and why less code = fewer bugs — kind of a sequel to "Rethinking Reactivity" () Here's a summary thread:
'Write Less, Do More' is the jQuery slogan. jQuery changed my life: I was working at a newsroom in South London, trying to learn to code so I could do e.g. fancy interactive dataviz like the big guys were doing, and I doubt I would have succeeded without it.
As it happens, 'write less' is one of the very few rules for writing *prose* that almost everyone agrees on. Every word should be doing work. It's not just about respecting readers' time — it helps you write prose that is *correct*. Flabby prose creates space for bullshit.
I've spent my career at the intersection of journalism and software, and I've come to believe that writing code has more in common with writing prose than it does with engineering. Martin Fowler said it well:
That's particularly true when we're talking about bugs. If you assumed a linear relationship between code size and bug count, that would be an incentive to reduce code size. But it's not linear — turns out it's *quadratic*.
It therefore stands to reason that if we use tools that let us express the same ideas with less code, just like jQuery did, our apps will be more robust. Here's a simple component implemented three ways: vanilla web components, React, and @sveltejs. These ratios aren't atypical:
(I had a joke here about how HTML, CSS and JS are the languages of the web, and that WC authors who cram markup and styles into their JS classes should come over and #UseThePlatform, but no-one got it. Maybe it'll fare better on Twitter?)
I had an epiphany a while back, after many inconclusive conversations about Svelte's "real" selling point — performance? bundle size? convenience? etc? The thing about being compiler-centric is that you have a totally different set of trade-offs — you can pursue them all!
One consequence: we can abandon the tired false dichotomy between features and size. Being feature-rich needn't mean being bloated, if you start from the right point. We can add a11y checking, spring physics, and other luxuries — for free!
We can also get amazing performance, which is important because the internet — including web technologies — is moving to even lower-powered devices. I call it the #EmbeddedWeb, though it hasn't caught on yet.
Speaking of low power, there's another constraint that we're not generally thinking about nearly enough. The internet is a huge contributor to the global climate emergency, and as technologists we're in a position to do something about it.
That's not just about choosing more efficient frameworks (though that does matter — if your SSR is slow, for example, you'll need more hardware to handle peak load). Lazy-load code. Stop tracking people. Use tools like Safari's new CPU meter.
Anyway. If writing less and doing more is good, then wouldn't writing nothing and doing everything be even better?
I'm not even joking. We used to have tools that allowed creators to make interactive, visually rich stuff on the web without writing code. We're reclaiming some of that lost progress, but we have so much further to go.

But that's for a future talk...
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Rich Harris

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!