âJustâ One Line
From Jeremy Keithâs piece âResponsibilityâ:
Dropping in one line of JavaScript seems like a victimless crime. Itâs just one small script, right? But JavaScript can import more JavaScript.
âItâs just one line of codeâ is a pitch you hear all the time. It might also be the biggest lie we tell ourselves â and one another.
âAdd styles with just one lineâ:
<link href="styles.css" rel="stylesheet">
âAdd our widget, itâs just one lineâ:
<script src="script.js"></script>
âInstall our framework in just one lineâ:
npm i framework
But âjust one lineâ is a facade. It comes with hundreds, thousands, even millions of lines of code. You donât know how many and itâs not usually disclosed.
Thereâs a big difference between the interface to a thing being one line of code, and the cost of a thing being one line of code.
A more acute rendering of this sales pitch is probaly: âItâs just one line of code to add many more lines of code.â
The connotation of the phrase is ease, e.g. âThis big complicated problem can be solved with just one line of code on your part.â
But, however intentional, another subtle connotation sneaks in with that phrase relating to size, e.g. âItâs not big, itâs just one line.â
But âone lineâ does not necessarily equate to small size. It can be big. Very big. Very, very big. One line of code that creates, imports, or installs many more lines of code is âjust one lineâ to interface with, but many lines in cost (conceptual overhead, project size and complexity, etc.).
The next time you hear âitâs just one lineâ pause for a moment. Just one line for who? You the developer to write? Future you (or your teammates) to debug and maintain? Or the end-user to download, parse, and execute?