Oftentimes, when I meet with other developers, I’m shocked by the way they use their development environment. A common pattern is to see someone with plenty years of experience in software development in their favourite IDE still using a mouse for refactoring, navigation, internet browsing or just working on multiple displays trying to do few things at the same time. There is a lot of misunderstanding about how to do what in the sfowtare development industry and I think that people are overwhelmed by the number of options. So instead of adding new stuff, we will remove the unnecessary. In the next few posts, I’ll share with you a better approach to building your development environment.
You may get some sense of it from the video below (watch it on Vimeo for better quality):
Doubling developer productivity – goals
First off, let’s define our goals. To really boost productivity we are going to:
- say goodbye to mouse
- utilize typing area instead of arrow keys, numeric keyboard or additional keys
- avoid distractions, floating windows, chats
- automate redundant tasks
- stay in the console as much as possible
- focus on one thing
Although, it’s possible to achieve everything I mentioned above with IntelliJ Idea or PyCharm, for me the real game changer was moving with everything I do to shell. Today I want to share with you five tools that doubled my productivity over a short period of time. These are zsh, vim, tmux, tmuxp and docker.
The shell – Zsh
Clearly, if you are a Non-Microsoft / Non-iOS developer you want to run some sort of Linux distribution with its amazing shell. No discussion whatsoever about it. It’s well known, fast, reliable and close to most of the production environments. My preference is ZSH combined with Oh-My-Zsh. It gives you powerful autocompletion, navigation, git support, and enhanced shell look and feel. It just speeds the way you move and do things.
The editor – Vim
Great development environment can’t live without an editor. Much choice is Vim, Linux editor, which can turn into a powerful IDE with just a few plugins and a bit of luck. I decided to drop PyCharm as it was not giving me as much for Python as IntelliJ Idea for Java mostly in terms of refactorings. If you are afraid that you will miss some functionalities – don’t be. Everything you can do in modern IDE can be done in Vim as well, but quicker. On the other hand, not everything you do in Vim will be possible in popular IDEs. Anyway, you will love it, I promise!
Windows and sessions – Tmux
For me, Vim does not exist without Tmux. When it comes to coding all you can see on my screen is an editor. So how does Tmux help? Let me put it simply, it gives you “tabs” for all non-vim related stuff like a shell, logs, git console, ssh sessions and much more. Additionally, you can keep dev environment fully separated from the production environment due to Tmux sessions. Switching between one and the other takes no more than 0.1 second – in my case, it’s as simple as typing followed by ). We will get to this later.
Everything else – Docker
One of the key points of dev environment is to make it reproducible with just one shell command. From time to time I like to break things while experimenting so it’s crucial to get back to the previous state in no time. For that reason I don’t have installed any services on my machine, instead I use Docker with docker-compose. Ports binding creates an impression that everything is installed on the local machine when, in fact, all the magic happens in containers. Some examples might be MySQL, PostgreSQL, RabbitMQ, ElasticSearch and many more.
Setup – Tmuxp
The Remaining question is, how to start all of the goodies in one go? Here Tmuxp comes into play. It turns out that you can preconfigure Tmux sessions so that the entire environment will boot with a single command. Plain simple and effective.
Doubling developer productivity – what next?
Since, it’s the first post in the series, we only scratched the surface. In next few posts, we will look at installation, vim and tmux configuration, basic moves, workflow and programmer productivity tips.
If you are happy with what you have at the moment in terms of development environment I encourage you to jump straight into productivity tips that apply mostly to geeks like me.