#[1]alternate [2]Thorsten Ball [3]Home [4]Books [5]Posts [6]Podcasts [7]Talks [8]Contact How much do we bend to the will of our tools? 04 Feb 2020 A few months ago, while looking at some code, a little light bulb that I didn’t even know existed went off in my head: “This was only written in this way, because the tools allow it to be written in this way.” Maybe it was a question mark, not a light bulb. All of us agree, of course, that, yes, with a sufficiently generous definition of tool, the tools we use when programming influence the programs. Programming languages, type systems, testing frameworks, linters, etc. – they’re all tools, in one sense or another and they all leave their mark. But that’s not what kept me staring. This was different, this code wasn’t just shaped by the language it’s written in, posture-corrected by a linter. No, this code was written by another type of tool. There are tools that help you write better programs and then there are tools that help you better write programs: auto-formatters, auto-complete, jump-to-definition, documentation lookup, search. The latter is what engraved the code I was looking at. And I freely admit, even though it might be shocking: I’m not a code savant, I can’t close my eyes, put my hand on a screen and whisper when code was written with which editor (I sincerely wish I could, but don’t tell my parents I said that). Yet I think it’s possible to spot an auto-formatter’s imprint. Because when you look at the code you simply realize: there’s no other way. We programmers are too lazy. Only with these tools would we write a program in such shape and form. Here’s [9]a snippet that’s similar in its peculiarities to the one that got me here, take a look: const editableTitle = inEditMode ?
{ evt.preventDefault(); try { const txt = (evt.target as any). text.value; await setTitle(txt); setCurrentTitle(txt); } finally { setEditMode(false); } } } >