Author: Mihai Avram | Date: 2/16/2020
A unique quality that I believe to be ingrained in most programmers and IT specialists is their unrelenting desire to get better. Get better at understanding code, or sorting that list of ice cream cone emojis faster.
[🍦, 🍧, 🍨] – Just yum!
Or perhaps learning a new language, picking up that brand new testing framework, and working faster! This article is for those coders, the ones that want to level on their up their speed when it comes coding and working in general! Here we go….
Shortcuts, shortcuts, shortcuts
You may know the basic shortcuts to make your life easier such as copy/paste since about the 5th grade. However, imagine if any repeated action you made on your machine while coding could be automated with a shortcut. Likely your productivity would increase a large amount. This is because your interactions with your best friend (your workstation) will take less time and your attention will not be fragmented by the time it takes. For instance, more complex shortcuts would be navigating to and from and to different software that you have running. Or going to the beginning of the line you are coding very quickly to change something instead of clicking there or trudging there character by character. While this topic is deep and we can only scratch the surface, the best tip is to check the documentation or google shortcuts for whatever software or operating systems you work often with, and try to find and remember the shortcuts for the things you do most!
Here are two great articles to get you started with this:
General Usage and Windows Usage – (39 No Frills Keyboard Shortcuts every Developer Should Know About)
Mac Usage – (12 Keyboard shortcuts every programmer should know)
Code Scaffolding Tools
This particular tip matters more if you have to start a lot of projects or microservices from scratch. The way scaffolding tools
work is that they usually have a minimally configured codebase that has all top-level features organized and the main files and configurables put together in one place for you to focus more on building the
features you care about instead of getting your code started and running. One popular example of this is the
npm create-react-app my-app from the React community which creates a starting and simple React app. A lot of other coding frameworks have such features in place such as the Vue CLI, the Ruby on Rails
generate command, and the Django startproject examples. You can simply google something like “<Your-Framework> code scaffolding tools and examples” and you should stumble across quite a few.
Some progressive projects behind this are Yeoman, Slush, and the Hackathon-Quickstart GitHub repository which all have a lot of different frameworks and languages to choose from.
Terminal and Preferably the Oh My Zsh Terminal Configuration
First of all, it goes without saying that if you are not using a terminal, then you should start to learn to do this first. While at first glance, it may be quicker to launch software by clicking instead of typing a command, the moment you need to configure, navigate or interact with the software, the navigation costs will start to feel like borrowed time. Put in context, the time it takes to configure a more complex set-up of a software and then run it may be long. In contrast, this could essentially be done with one command in the terminal. Sure, maybe this command may take some time to build up at first, but afterward, you can simply run it by pasting it in the terminal which happens instantaneously. Learn to use terminals, it will help you save a lot of time! Now that we got that over with, let’s talk about Oh My Zsh. This software is an open-source framework for managing Zsh (which is a terminal configuration). By using Oh My Zsh and its numerous plugins and themes, you can essentially decorate your terminal and commands to do the things you are always looking for and doing – all very quickly. Here are some examples of this:
- Leveraging the alias
git checkout masterin your terminal.
ESCtwice to prefix any previously-run command with sudo.
- Adding syntax highlighting so you have better cues on which commands you run in the terminal are valid.
And this is just the tip of the iceberg, for a more in-depth look at Oh My Zsh, check out this great video (Learn Zsh in 80 Minutes – Oh My Zsh – Command Line Power User)
A Good IDE For Your Needs
While most developers already use an Integrated Development Environment (IDE), it is essential to ask what one is using it for. Besides a single place that holds all of our code, IDEs can be very powerful by offering debuggers, compilers, terminal support, IntelliSense, automation tools, and much more. You should first start by asking yourself what features you really need, what programming language you use, and if you value the speed or quickness of the IDE. Generally speaking Vim and Sublime text are amongst the quickest. Alternatively, if you only code in Python, PyCharm is one of the best IDEs for the language. Otherwise, it is worth looking into some of the heavyweight and more powerful IDEs such as Visual Studio and Atom, look at all their features, and use the ones that have the features you want.
Here are some links to get you thinking about which IDEs may be best for you:
High-level overview from Wikipedia – (Comparison of integrated development environments)
Conversation on Quora – (What is the best IDE?)
One of many IDE comparison articles – (What are the best IDEs?)
Finding Tools and Chops
Sometimes our time spent is spent on coding, but sometimes it is spent on searching. Why not make searching faster instead of going to your Finder or File Explorer and searching using the GUI. The Silver Searcher is one of the best tools for this, as it can search for words in files, or files in folders and any combination in between. What is more, is that The Silver Searcher claims to be much faster than ‘ack’ which is another command-line tool to search for words and files. So get to know The Silver Searcher, the ‘ack’, ‘grep’ and ‘find’ commands so you can search for things very quickly the next time you need to do so.
Note that most of these tools work very well with the Mac and Linux operating systems, and some can even be configured in Windows, just google “Installing ack in Windows” for example.
Here are some good use cases of this:
find /project -name config.jsonto find if there is a config.json file under the project directory and also show where it is located.
grep -i -r "bug" .to find all instances of the word bug (case insensitive) recursively in your current directory files.
ack bugto find instances of the word “bug” in all of the files in the current directory, and all children elements (recursively).
ag 127.0.0.1to use The Silver Searcher and find all instances of localhost in all the files in the current directory (recursively). This is the fastest tool and command of all of the ones mentioned here.
For more information, check out the following links:
Find – (Linux/Mac Terminal Tutorial: How To Use The find Command)
Grep – (Linux/Mac Terminal Tutorial: The Grep Command – Search Files and Directories for Patterns of Text)
Ack – (Top 10 reasons to use ack for source code)
The Silver Searcher – (Documentation and Code on GitHub)
Once you learn how to quickly navigate software in your operating system you will start to get things done quickly and even allow yourself to consume more information quicker since you will be context switching much faster, if at all.
Get to know how to quickly navigate between the software on your machine and operating system with the following commands.
Alt + Tab
Command + Tab
(Super or Alt) + Tab
Get to know how to snap windows in different places of the screen so that you can cross-reference your work (e.g. reading about something on Stack Overflow while also coding in your chosen IDE the from above :p).
Windows Key + Arrow Keys
Mac: Check out Magnet or some of the free alternative software out there
Super + Arrow Keys
Memorize these commands if you haven’t and make constant use of them. You will start to see your productivity soar!
Other Miscellaneous Tips
Some other important ways to improve your working and coding speed that come to mind are:
- Using version control (e.g. Git, Mercurial)
- A desktop/laptop which is powerful enough to handle all your work quickly (in milliseconds not seconds)
- Automation-first thinking
- Two regular monitors/screens or one large monitor
That’s all for now. I hope this all helps and happy coding!