Lazy like a fox: 8 ways great programmers save time and energy

The best developers share an important trait: laziness, which translates to a constant quest to find the most efficient ways to get the job done, in both the short and long terms

A man lying on the floor, using a several straws joined together to drink from a bottle

Laziness, Perl creator Larry Wall once wrote, is “the first great virtue of a programmer.” Apparently, he’s not alone in that thinking. Just ask Bill Gates. Heck, why do you think Grace Hopper invented compilers? That’s right - because she was lazy and didn’t want to write machine code. Great programmers translate their laziness into efficiencies by constantly finding easier ways to do things. Sometimes that means saving time in the short run, but other times it means spending a little more time upfront to save a lot of time (and effort) in the long run. Here are 8 common ways that the best developers save time, effort and (often) their sanity.

Video of the scarecrow getting his diploma in the Wizard of Oz

Thinking big

What and why: When given a problem to solve, rather than coding right away, the truly lazy programmer will first sit back and think about the big picture. Is the bug to be fixed a symptom of a larger issue that should be addressed now to prevent future problems? Could a requested enhancement be implemented in a more general way that could support future functionality and save time later?

Quotes: “Lazy programmers look at the whole system, and try to find the way to satisfy as many goals as possible, having learned through experience that not satisfying as many goals as possible will surely lead to annoying rework" Anonymous

“A moment spent thinking can literally be worth months spent coding." Jeremy Bowers

Picture of a sign in front of a driveway to a house which says Not a shortcut

Using keyboard shortcuts

What and why: Replacing mouse-driven commands with keyboard shortcuts is a great way for anybody to reduce effort, but programmers are especially love them. They often take advantage of shortcuts specific to the OS, IDE and the browser to increase productivity. Less mouse usagealso has an added benefit of reducing repetitive stress injuries.

Quotes:  “Learn your keyboard shortcuts because you do not want to leave your keyboard for your mouse. Consider your mouse as evil.” Petar Radošević

“... learning keyboard shortcuts can save you a world of hurt. It also gives you a big performance boost.” Kelli Shaver

“Lazy people will quickly learn keyboard shortcuts, like every good programmer should….” Roy van Rijn

Picture of the letters SOS

Googling for help

What and why: Programmers, like everybody else, don't like reading manuals or documentation; it’s usually quicker and easier to search the Internet for help. Web sites devoted to answering programmers’ question, like Stack Overflow, aren’t just time savers, they also contain a wealth of information and accumulated wisdom and have become a vital tool to developers - even if they can’t always provide the answer.

Quotes: “What a game changer (not to mention a time saver) Stack Overflow has become.” Ken

“Googling for solutions ... is a great way to learn new stuff and approaches.” Martin Wickman

“The sooner you become effective at googling for programming help, the happier you'll be.” Seph

Picture of a bag with the words, Reduce, reuse, recycle

Reusing code

What and why: “Don’t reinvent the wheel” is a common developer refrain, which is why they will often reuse existing code, either their own or someone else’s. This can range from copying and pasting code to using code that was explicitly written for reuse, which can not only save time, but also lead to a better product.

Quotes: “... being a lazy programmer also means … Using code snippets instead of writing boilerplate code.” Marc Duiker

“Old code has been used. It has been tested. Lots of bugs have been found, and they've been fixed.“ Joel Spolsky

“Good programmers know what to write. Great ones know what to rewrite (and reuse).” Eric Raymond

Video of Wallace & Gromit movie, showing a homemade contraption to suck up crackers

Automating repetitive tasks

What and why: Programmers often have to do the same mundane thing over and over again, which can not only be time consuming, but also boring. Automating repetitive tasks through scripts is one way to free up time in the long run, even though it may take more time in the short run. Plus, it’s often more fun and challenging to write a script than do the actual (non-challenging) task in the first place.

Quotes: “As the mantra goes, anything done more than once is a candidate for a script” Mariusz D

“You learn more by automating it then by doing it” john188yyc

“Automation leads to relaxation” Al Lilianstrom

Picture of a desks in a classroom set up for students to take a test

Writing unit tests

What and why: Lazy programmers realize that while writing unit tests (i.e., code to test individual units of software programs) may require more effort upfront, it can reduce the number of bugs in their code, thereby saving time (and headaches) in the long run. Unit testing can also make code easier to maintain and refactor in the future.

Quotes: “Yes, unit tests take time. But so does ‘random bug fixing’.” Arve Systad

“... automated [unit] testing is one of the laziest things a developer can do!” Swizec Teller

“If you’re a truly lazy programmer that doesn’t want to deal with all that s*#@, write tests.” Grey Ang

Picture of a sign that reads Road Work Ahead

Refactoring frequently

What and why: Restructuring functioning code may not seem lazy, but lazy programmers know it will save time later, by making future development and bug fixes easier. The key is to not wait until the refactoring job is too large, but to instead do it in small chunks on a regular basis.

Quotes: “When writing software, every moment spent improving your code up front is time saved later, when you're really going to need it.” S.Robins

“In our analysis, spreading refactoring work out meant that we were able to reduce development effort required on the majority of feature-driven projects.” Andre Pavlovic

“Lazy programmers… Constantly refactor because if they don't do it now, later's gonna suck” James Tharpe

Picture of a LEGO version of the time machine from Back to the Future

Using source control software

What and why: Manually tracking changes to source code files can be slow and painful, particularly when multiple developers are involved, but not as slow and painful as having to rewrite code that gets deleted or overwritten. Lazy programmers know that source control software saves time and pain by automating the former and eliminating the latter.

Quotes: “You feel like you're saving time and headaches by not using version control, but the day will come, if it hasn't already, where you go down a false coding trail and want to roll back.... All of this takes much longer with versioned folders than it does with a proper version control system.“ Corregan Brown

“For me big time-savers are: use version-control….” Mnementh