How to automate your workspace and write less code

in #development5 years ago (edited)

When it comes to developing robust software, your workspace setup can determine your overall productivity. As engineers, our code workspace also doubles up as the tool that helps us create the code we need. Our overall efficiency depends on how well our workspace is set up.

A well-structured workspace with good processes can help you remain in your flow state longer, keep you emersed and help you stay focused on your tasks. Distractions caused by manual work will eventually slow you down, along with repetitive tasks that contribute to the overall time sinks in your code creation process.

Writing less code is not just about the number of lines you produce or characters you end up typing. Rather, it’s also about how much of the manual and repetitive stuff you can do without.

Here are a few things you can do to reduce to amount of actual code you need to personally create, reduce the amount of time you spend doing certain tasks, increase your overall productivity and ultimately write less code.

1. Use auto-complete template code

There are perks and quirks to writing all your code personally. However, after you’ve been coding for a certain number of hours, you’ll start to see patterns in your code.

These patterns often make up structural templates and foundational outlines in your code. When it comes to using pre-made code, code templates or snippets are designed with best practices. They’re structured in a way that ensures the ability to uniformly create your code. This comes in handy especially for team environments and when you need to share code around.


Get this snippet

Snippets offer standardization and when paired with auto-complete, the process of generating code is significantly reduced. This leaves you with more time to think about the code, how it should fit together and what it needs to do to satisfy the feature’s requirements.

2. Using AI auto-complete

AI code completions can not only take boilerplates a step further but can introduce a new level of efficiency. AI based completions can offer you helpful suggestions that you can accept or reject based on context and historical actions.

Rather than just guessing what you’ll type next, code completion IDE plugins, like Codota and Tabnine, act as an auto-code complete tool that also offers up examples that are relevant to your coding context.

In contrast to other plugins, Codota pools usage data together (without actually seeing your code) in order to fuel the coding prediction process and help you create your code faster.

3. Learn and Implement short keys

The point of optimizing your workspace is to reduce the number of keystrokes you need to press in order to complete your tasks. The act from moving between the keyboard and your mouse can also break your flow state due to the movement changes.

Predefined actions often address the commonly used actions that developers perform that’s beyond the act of coding. For example, in Android Studio, if you want to quickly jump to the source, you can just press Ctrl + Enter or F4. This will significantly save you a great deal of time in a manual search, especially for larger applications.

When it comes to workspaces, IntelliJ, Android Studio, and Eclipse all have the ability for you to configure keyboard shortcuts to suit your most commonly performed actions.

For IntelliJ and Android Studio, you can configure this via Settings/Preferences or Ctrl+Alt+S. Then all you have to do is select keymap. You can’t change the predefined keymaps but you can modify any other shortcuts that you may need to access your code editor’s other features.

shortcuts for android studio

For Eclipse, this functionality is found under General > Keys.

4. Integrate with project management tracking tools

Not many developers do this enough when it comes to their workspaces. Businesses often use some sort of project management tool such as Asana and Jira to track tasks, project progress, sprints, and burndowns.

If the project management tool is made for developers, chances are that there will also be an integration tool that’s available for your IDE.

In IntelliJ, you can connect your IDE up to a tasks server (available via Tasks > Servers) without the need to download anything in addition. Your team will need to set up a server URL, along with a project ID in order to view and associate your code to the right task.

For IntelliJ and Jira, there is a plugin called Atlassian Connector that will allow your IDE to monitor and update issues without the need to navigate away and into a browser.

jira for intellij

5. We need to talk about linters

When we write code, it’s not always perfect the first time around. Sometimes, when we write code, we spend a good amount of time trying to get braces and brackets in the right places and with the right spacing. They may seem small at first but those seconds do eventually add up to minutes, which can snowball into an hour here and there throughout the entire project.

Sometimes, we find ourselves sidetracked and distracted by the act of cleaning up formats and getting things to look right only to have it destroyed when new code is added.

That’s where linters comes into play.

Code lint is annoying and cumbersome to maintain. It sticks out as minor annoyances that can turn your code into a sloppy mess if not maintained regularly. It comes in the form of physical styling of the code and potential programmatic errors that may not be immediately evident until you run it.

Linters takes away the manual task of checking your code, automatically formats it to standard and flags any errors for you to review. Linters can also help standardize your code across teams and reduce any discrepancies on style and formatting.

This, in turn, reduces your need to worry about how things should look and let you focus on the important parts of the application creation process.

6. Are your settings synced?

Sometimes you’re not always working on the same machine. Or perhaps you’ve just upgraded your workspace. Whatever the scenario, most IDEs have a sync option that allows you to move your personal settings around without the need to manually set it all up again.

For IntelliJ, you can do this by using the IDE Settings Sync functionality. For this, you’ll need a JetBrains account and all your settings will be synced to this.

IDE Settings Sync for Intellij
For Eclipse, using version control like Git will allow you to automatically import workspace configurations for a particular project into your IDE. However, you should note that issues can occur if you link multiple repositories together and you don’t have them all available on your current machine. This is because your workspace configuration is project-based and linking multiple projects together can cause an issue with syncing.

Final thoughts

When it comes to productivity, there’s more to it than just the number of lines you can produce within a time block. As we all know, the process of creating code itself requires other actions that eventually add up to form your day as a developer.

Your flow state plays an important role in maintaining the velocity of your thoughts and setting up your workspace to help maintain it can make or break your ability to maximize the impact of your concentration.

Flow is the moment where you are completely immersed in your work. Breaking flow can add more than just the seconds it took to do the task. The additional time also includes getting back into the flow and picking up your train of thoughts all over again. The simple act of moving between keyboard and mouse can sometimes be just enough to break your flow.

Little tweaks such as using boilerplates, code completion, learning the keybindings, and linters can make your workflow just a little bit smoother. These things can help smooth up what would usually be road bumps in your thought processes, and therefore help prevent you from slowing down every time something minor and repetitive needs to be done.

-=-=-=-
(This post was originally published on the Codota blog and is syndicated here by request of content owner.)

Sort:  

Modern IDEs are very good at shorten your code. I remember when I was writing C# i can use the Resharper to make 5-lines of code into a one-line Fancy LINQ.

I’m not a coder, but this makes perfect sense to me. Sometimes I wish I had gone into engineering. It’s so sensible yet creative. At my company we use Jira, which you mentioned. I love Atlassian products for time/task management.

This is such a great set of tips, @techslut. I learned some things! I didn’t know until reading this what a “linter” is, and I had no idea there were such things as AI code completion tools!

My job takes me into interesting niches. :)

Do you teach? You seem like a natural teacher to me. This was perfectly explained so that even a mildly technical person could easily grasp all the concepts.

Nope. I write content. This particular post was written by a different author on my team, but I syndicate it here regardless as Codota requested that I do. I also write about GMP regulation, GDPR & CCPA, B2B marketing online, ad fraud and mobile device and network security.



This post has been voted on by the SteemSTEM curation team and voting trail. It is elligible for support from @curie and @minnowbooster.

If you appreciate the work we are doing, then consider supporting our witness @stem.witness. Additional witness support to the curie witness would be appreciated as well.

For additional information please join us on the SteemSTEM discord and to get to know the rest of the community!

Please consider using the steemstem.io app and/or including @steemstem in the list of beneficiaries of this post. This could yield a stronger support from SteemSTEM.

To listen to the audio version of this article click on the play image.

Brought to you by @tts. If you find it useful please consider upvoting this reply.

Hi, @techslut!

You just got a 0.04% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hi @techslut!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 5.962 which ranks you at #337 across all Steem accounts.
Your rank has dropped 1 places in the last three days (old rank 336).

In our last Algorithmic Curation Round, consisting of 115 contributions, your post is ranked at #18.

Evaluation of your UA score:
  • You've built up a nice network.
  • The readers appreciate your great work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.034
BTC 90827.60
ETH 3116.50
USDT 1.00
SBD 2.97