DEV Community

DeChamp
DeChamp

Posted on

Code like a machine

Human's are only good at repeating 1 to 2 steps without having slow down. So if you want to code like a machine, then do just that. What do I mean? Let me show you.

I have a long list of nav items I have to add data attributes to. I have to compare it to an existing nav which I'm porting over to React.

There are hundreds of links and some of this I can't do with a regex find/replace. So to speed it up, I'll give myself a single task to add to each link, then another simple task to repeat again.

I have to fill out things such as the title, position, aria, etc...

Instead of trying to copy and paste all of the elements at a time, title, position and so on... I pick 1 thing to do, so I start with the title and go down the list. Then I come back to the top and I start with the position and so on.

This makes it much quicker because I don't have to think about what I'm doing because it's a single task, I just do it.

If I were to copy the whole thing over for each nav, I might copy of the title, the position and then have to remember what else to copy over next for every list item. That is a lot to track and remember.

I apply this to a lot of things in my life, even my laundry. Instead of grabbing a random piece of clothing from the pile, shaking it out, folding it and then putting it in its matching pile, I do this instead.

I first sort all my clothes in to piles they belong in, then I shake them out/straighten them.

Now i have organized piles of cloths to go through so I don't have to think, just do.

My shirts are all in one pile, face up. I can grab my hangers and quickly hook them all on in one quick swoop. Next I fold my pants, just grab, fold and move on.

I think you get the point. I'd love to see how much time it saves you.

So try this little trick and let me know if it helps you.

P.S. If you have any cool tricks or tips you use to be productive, please drop them in the comments below.

Top comments (2)

Collapse
 
michaeltharrington profile image
Michael Tharrington

This is awesome advice!

I'm seriously awful about stretching myself across multiple tasks at once which can be sooooo distracting to the point of being debilitating.

But, like you're pointing out here, if I can take a big task and break it up into small repeatable processes, it's generally so much easier to get in a rhythm and get things done.

Collapse
 
dechamp profile image
DeChamp

I'm glad I could offer a little help! Little tricks like this help me keep my life and code flowing when they feel like giant tasks. Thanks for commenting!