DEV Community

Cover image for What are some examples of "productive laziness"?

What are some examples of "productive laziness"?

Ben Halpern on July 01, 2020

Famous Bill Gates quote:

I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.

There is definitely some truth here, but it may not be intuitive: What are some examples of how this plays out in real life?

Collapse
 
miketalbot profile image
Mike Talbot ⭐

Well, I guess you should always write as little code as possible. Every line you write has a chance of having a fault. For me I'd always choose to use battle-tested modules - I have a mantra: "Build what you must, not what you can".

Collapse
 
habereder profile image
Raphael Habereder • Edited

If I have to create the same damn folder structure every other day, according to some stupid "guideline" that differs from the rest of the world, or best practices, you can be damn sure I will script the hell out of that and build a generator for it after the third time.

That way I'll just go

buildProject.sh projectname

Or

git clone urlToSkeletonProject.git

and be done with it :D

Or build metric tons of aliases like

alias ka="kubectl apply -n namespaceofmyteam"
Collapse
 
xanderyzwich profile image
Corey McCarty

custom aliases for the win! Also ssh keys for passwordl-ess logins. bash/python scripts are an amazing way to streamline repetitive tasks, and make huge problems quite small.

Collapse
 
habereder profile image
Raphael Habereder

I couldn't agree more.
If I look at the bashrc I crafted over the years, I couldn't live without it.
An alias to save a few keystrokes is probably peak lazyness.

Also ssh keys for passwordl-ess logins.

So much this, not only from a lazyness perspective, but also security. Forging a ssh-key is probably much harder than brute forcing a password (if you don't get banned after too many failures :p)

bash/python scripts are an amazing way to streamline repetitive tasks, and make huge problems quite small

Absolutely, though lately I prefer go, just for the benefit of not having to install a runtime anymore.

Thread Thread
 
xanderyzwich profile image
Corey McCarty • Edited

A couple of my favorites are the ls after cd script and this charm that I came up with that I insist be deployed everywhere that my app is running (along with a sensible multicolored prompt) what="echo `whoami`@`hostname`:`pwd`"

Thread Thread
 
habereder profile image
Raphael Habereder

I am absolutely going to steal that one!

A favorite of mine, even though it's absolutely useless

alias damnit="sudo !!"

It's just to create fun bash histories :D

Collapse
 
fluffynuts profile image
Davyd McColl

^ this

if there's something you have to do regularly, please, for the love of all that is good, find a way to automate it

As Scott Hanselman says: "we only have a limited number of keystrokes we can make in this life" -- so we have to make them count.

Collapse
 
jmplourde profile image
Jean-Michel Plourde

In my everyday life, it means

  • using git ZSH aliases
  • VIM key biding in firefox and my IDEs
  • using Albert in Linux and many of its useful commands

I want to leave my keyboard as little as possible

At my job, it means

  • Using a project cookie cutter: you start it, answer some questions and it generates the directory and all the config files for the modules you asked
  • terraform cookie cutter: answer questions about the services providers you need and it generate all the policies and change you need.
Collapse
 
piyushkmr profile image
Piyush Kumar Baliyan

Bash aliases especially for git. I am too lazy to type git push origin HEAD and just use gpoh.
Similarly I have a custom bash function for git commit -m, and I use gcim. This function also adds my current JIRA ticket in commit message.
Read more here:

Collapse
 
sarehprice profile image
Sarah Price

Using templates for projects when you don't absolutely need to create everything from scratch all the time. I love to hate on Canva, but it makes making social media content so much easier and faster.

Collapse
 
fluffynuts profile image
Davyd McColl

I just wrote a cli npm module to bootstrap typescript npm modules (including cli ones). I'd like to add an interactive mode first, but, at some point, I'm going to blog about it here.

It sets up the following:

  • Checks if your desired package name is available
  • Initialize git
  • Initialize package.json
    • What files to include
    • Starting version
    • Author info
  • Setup LICENSE and field in package.json
  • Create skeleton README.md
  • Install dev dependencies:
    • Typescript
    • Jest & ts-jest & expect-even-more-jest
    • Faker
  • Install run-time dependencies:
    • Yargs (for cli apps)
  • NPM scripts
    • build (transpile your .ts to the dist folder with declarations)
    • test
    • lint
    • start (runs your cli app, if you chose the cli route)
    • release ( & beta release when you just want to test something)
  • Seed project files
  • Build to test output

I can go from npx to published cli hello, world app in about 5 minutes (of which at least a minute is creating an empty repo on github)

Why did I do this? Because I wanted to seed 4 TypeScript-based NPM modules, saw a pattern and got mad with the amount of time it takes to do the above by hand. LAZY.

The right kind of lazy gets shit done :D

Collapse
 
rubiin profile image
Rubin

For me , I write bash scripts for automating most of the stuffs that takes me more than a minute to do manually. For instance, I have 5 different modules in 5 repositories and I have a another repository solely for storing their builds. Manually cd'ing into the individual directory, running the build command and then copying the dist back to the final repository can take me couple of minutes. So i just have a shell script do that for me :D

Collapse
 
fluffynuts profile image
Davyd McColl

Perhaps also how I just wrote a GreaseMonkey script to automatically translate tweets when the option is available -- because I was reading some Russian dude's timeline and clicking links is so last year; perhaps I'll have enough motivation to finally learn how to create, package and release a web extension? I'll have to overcome some severe laziness first though :/

Collapse
 
mellen profile image
Matt Ellen-Tsivintzeli

I like to question if things are necessary. The less I have to do the better.

For example, I was told we had to hold all the state and store it to FRAM, in case of a powercut, but it turned out that since there's no way to tell between genuinely powering off and a powercut, there's no way to tell what state is correct, so storing it is a waste of time.

Collapse
 
rubiin profile image
Rubin

I also have bash aliases for commands I frequently use like for package managers (yarn,npm) and docker .Also for doing ssh . It is not that big of a deal
but saves me couple hundred keystrokes per day and also prevents me from entering any wrong commands

Collapse
 
colewalker profile image
Cole Walker

When I stream on twitch I have a few servers I need to run beforehand for chat interactivity, and I got so sick of remembering to do it that I set up a bash alias for "stream" which will do all of the setup for me. It saves a few seconds, but it feels great.

Collapse
 
ankitbeniwal profile image
Ankit Beniwal

Using (my mechanical 😜) keyboard rather than mouse.

Collapse
 
thomasbnt profile image
Thomas Bnt

I agree with that quote !

Collapse
 
taylorbeeston profile image
Taylor Beeston

3/4 of the stuff I do in vim. Oh, I need to go 14 lines down? 14j is 11 keystrokes less than 14 js...

Collapse
 
gsto profile image
Glenn Stovall

I'm more from the Steve Jobs school of productive laziness: The strategic "no."

Sometimes the most productive thing you can do is nothing at all.

Collapse
 
codingmindfully profile image
Daragh Byrne
Collapse
 
madza profile image
Madza

All the automated stuff :)

Collapse
 
codingmindfully profile image
Daragh Byrne

Deliberate rest. Doing nothing for a while, or napping, with the intention of refreshing yourself to get more done later!

Collapse
 
daniel2231 profile image
Daniel Kang

“Laziness is the first step towards efficiency.”
― Patrick Bennett

Automation using zapier?
For those who have played the game "Factorio" should know the importance of automation.

Collapse
 
maxart2501 profile image
Massimo Artizzu

What this guy did:
github.com/NARKOZ/hacker-scripts

Have a laugh! 😀

Collapse
 
ferricoxide profile image
Thomas H Jones II

I first learned to write shell scripts because using command-history and line-completion were too much bother.

Collapse
 
hammertoe profile image
Matt Hamilton

Sleep.