“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?