5 Tiny Developer Workflow Tips to Improve Your Productivity
Tags: productivity, discuss, programming, career
Published: 2022-05-10 15:08:16

---
title: 5 Tiny Developer Workflow Tips to Improve Your Productivity
published: true
description: Incorporate these seemingly insignificant tips into your workflow and see your productivity skyrocket.
tags: productivity, discuss, programming, career
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a3s6vphu24lt1gyy26r4.png
canonical_url: https://rrawat.com/blog/5-developer-productivity-tips
---

As a software developer, we're constantly on the move trying to learn and build new things. It is all about acquiring knowledge and implementing it. This requires us to constantly reassess what's the best way to get the job done (you must've heard _don't reinvent the wheel_ a hundred times by now, right?).

In this article, I wanted to share some of my revelations as quick tips that will improve your productivity at work. It won't even take you 2 minutes, but it might save you from a lot of headaches.

Here are 5 tiny, seemingly insignificant but useful tips:

- 💾 Format on save in VSCode
- 🌉 Squash commits before rebase (whenever you can)
- 🗻 Find and replace in VSCode
- 🖨️ Use VSCode extension for console logs
- 🔌 Shut down your mac (at least occasionally)

The rest of the article will expand on each of the above points. If you were only looking for tips, there you have it. You can choose to skip what follows. But read if you want to learn more.

## Format on save in VSCode

How many times have you manually corrected formatting issues in your code? We've all been there during our web development journey.

No more manual labor of formatting the code. Install Prettier on VSCode.

Once you have the prettier extension installed,

1. Head over to your VSCode settings (`cmd + ,` on mac) and check `format on save in editor` option.
2. To confirm, simply open any of your files with intentional formatting mistakes and just hit save.

If you want fine-grained control over formatting rules or you have different formatting preferences across different projects, simply create a `.prettierconfig` file inside each of your projects with your desired formatting rules.

![Format on save](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3q4plpovc18tpjfextjy.gif)

To learn more, check out the [Prettier's official documentation for VSCode](https://github.com/prettier/prettier-VSCode#prettier-formatter-for-visual-studio-code).

## Squash commits before you rebase (whenever you can)

If you're working on a shared repo, chances are that the base branch has moved while you were working on your feature branch. In such scenarios, merge conflicts are inevitable.

This is something I've witnessed firsthand, not realizing that I can completely avoid the pain of hunching over, carefully resolving conflicts, and spending way too much time unnecessarily.

Problem? Whenever the base branch you're working on moves, you usually rebase your feature branch to make sure it has latest changes. If you have multiple commits in your feature branch, resolving merge conflicts becomes ‌harder during rebase.

While you cannot avoid the merge conflicts, what you can avoid is the time spent on resolving them.

Here's the pro tip: **squash all the commits in your feature branch, and then perform the rebase on the base branch.**

How it helps? It works because:

1. Your **single squashed commit** contains your **latest** changes, so it's easy to identify your changes vs changes on the base branch during conflict resolution. And,
2. You just need to resolve the conflict once as opposed to multiple stages of conflict resolution for rebasing each commit.

## Find & replace in VSCode

I'll be the first to admit, I've been using the `cmd + D` command for ages to select all the occurrences of a word in VSCode.

Here's what I used to do for _find and replace_ in VSCode:

1. Highlight any word in VSCode (either by double-clicking on the word or by pressing `cmd + D` while the cursor is on that word).
2. Keep hitting `cmd + D` until all the occurrences are highlighted.
3. Type out whatever I want to change those words to.

But it is case-insensitive. Most often, I don't want that because it may end up changing things by accident‌. Now, I've made it case-sensitive by default.

![Find and Replace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j05jtatzhgx7eerz55bx.png)

Just hit `cmd + F` and make sure to select the `Aa` icon.

Here's the modified find & replace:

1. Highlight any word in VSCode (either by double-clicking on the word or by pressing `cmd + D` while the cursor is on that word).
2. Enter the new word you want to replace the highlighted word with.
3. Hit `Replace all` to replace all occurrences at once.

![Better Find and Replace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x45yvjmx0jicac5rshqp.gif)

With this, you can now find & replace any word in your code without worrying about case 😌.

## Use VSCode extension for console logs

We all have been there. Consoling the heck out of the program to figure out what’s the issue. Given the number of times I console log, ‌I needed some hotkey for doing that.

You can install [javascript console utils](https://github.com/whtouche/VSCode-js-console-utils) VSCode extension. It lets you:

1. Write an empty console log by hitting `cmd + shift + L`.
2. Write console for any variable by highlighting it and hitting the same set of keys.
3. If you want to remove all console logs from a file, press `cmd + shift + D`.

![Console log](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7wbq31tegxbcjt8vg9j.gif)

_Neat ✨_

## Shut down your mac (at least occasionally)

I used to never shut down my mac because it is convenient. Just open the lid and bam, it's ready to go. It never made sense to shut it down. Until recently when it started stuttering between trivial operations.

While I'm aware there's a lot of debate around this topic and both sides (shut down vs. sleep) have reasons to prefer one thing over the other.

But based on my personal experience, not shutting down my mac for months caused performance & thermal bottlenecks.

Now I use a combination of both. I shut down my mac on the weekends. You can read more on the [Apple's official forum](https://discussions.apple.com/thread/3740114).

## Done tweaking? Awesome!

That's it! These were some of quick tips that you can incorporate in your workflow right now to elevate your productivity at work.

Let me know how many of these are already in your productivity arsenal and if there's any other micro fix you follow for better developer experience or quality of life improvement at work.