Lt Hopper and her colleagues started filling notebooks with bits of tried-and-tested, re-useable code.
By 1951, computers had advanced enough to store these chunks - called "subroutines" - in their own memory systems.
By then, Grace was working for a company called Remington Rand.
She tried to persuade her employers to let programmers call up these subroutines in familiar words - to say things such as: "Subtract income tax from pay."
She later said: "No-one thought of that earlier, because they weren't as lazy as I was."
In fact, Grace was famed for hard work.
Image copyrightGETTY IMAGES
Image captionGrace Hopper was posthumously granted the Presidential Medal of Freedom in 2016
But what Grace called a "compiler" did involve a trade-off.
It made programming quicker, but the resulting programmes ran more slowly.
That is why Remington Rand were not interested.
Every customer had their own, bespoke requirements for their shiny new computing machine.
It made sense, the company thought, for its experts to program them as efficiently as they could.
Grace was not discouraged: she simply wrote the first compiler in her spare time.
And others loved how it helped them to think more clearly.
Kurt Beyer's book, Grace Hopper and the Invention of the Information Age, relates many tales of impressed users.
One of them was an engineer called Carl Hammer, who used the compiler to attack an equation his colleagues had struggled with for months.
Mr Hammer wrote 20 lines of code, and solved it in a day.
Like-minded programmers all over the US started sending Grace new chunks of code, and she added them to the library for the next release.
In effect, she was single-handedly pioneering open-source software.
Grace's compiler evolved into one of the first programming languages, COBOL.
More fundamentally, it paved the way for the now-familiar distinction between hardware and software.
Image copyrightANITA BORG INSTITUTE
Image captionDr Telle Whitney co-founded the Grace Hopper Celebration in 1994 to encourage women into computing
With one-of-a-kind machines such as the Harvard Mark 1, software was hardware.
No pattern of switches would also work on another machine, which would be wired completely differently.
But if a computer can run a compiler, it can also run any program that uses it.
Further layers of abstraction have since come to separate human programmers from the nitty-gritty of physical chips.
And each one has taken a further step in the direction Grace realised made sense: freeing up programmer brainpower to think about concepts and algorithms, not switches and wires.
Grace had her own views of why colleagues had been initially resistant: not because they cared about making programs run more quickly, but because they enjoyed the prestige of being the only ones who could communicate with the godlike computer.