Time-saving Tools for Developers. Part 2: Dev Tools and Approaches

Hey! You are reading the second part of the article about everyday time- and effort- saving tools for developers. The first part was dedicated to work management, such as planning, communication, and information handling.

Time-saving Tools for Developers. Part 1: Planning and Communication

Here we will talk about coding – in particular, about time-saving tools, development approaches, and some small tricks.

Undoubtedly, every software engineer has their own set of tools and approaches. There are so many of them that it is impossible to gather a list of the best fitting all needs. That’s why I asked my teammates at Railsware, a product studio that has created Mailtrap and other great products, what development tools help them save time and effort in their daily working process.

Before we get straight to the point, I would like to note that technologies develop at lightning speed now. What was considered an innovation yesterday becomes a standard today. Effective software engineering is based on approaches rather than particular tools. Productive collaboration and automation are two basic principles that help us achieve better results. 

Git/GitHub tips and tricks

GitHub is our main development collaboration tool, so let’s start with the Git-related techniques that can save you time and sometimes nerves. 

Git aliases 

Git aliases are shortcuts you can create for the Git commands that you frequently use. Some developers use auto-completion for lengthy commands, but it still requires pressing “Tab” and can lead to mistakes. That’s why we use so-called mnemonics – combining the letters  the consecutive words start with. 

To create your aliases, edit .gitconfig in your user directory. 

Here are some of our favorite aliases:

  • alias.cop – awesome for switching branches by partial name
  • alias.prune-branches – for cleaning up old branches
  • alias.psoh – initial branch push with origin tracking
  • alias.aliases – show aliases

And here is a more detailed list:

$ git aliases
alias.aa add --all
alias.ap add --patch
alias.branches for-each-ref --sort=-committerdate --format="%(color:blue)%(authordate:relative) %(color:red)%(authorname)       %(color:white)%(color:bold)%(refname:short)" refs/remotes
alias.ci commit -v
alias.co checkout
alias.pf push --force-with-lease
alias.st status
alias.aliases config --get-regexp alias
alias.a add
alias.st status
alias.s status -s
alias.ci commit
alias.amend commit --amend
alias.rb rebase
alias.co checkout
alias.nb checkout -b
alias.br branch
alias.fe fetch
alias.cp cherry-pick
alias.d diff
alias.dc diff --cached
alias.ps push
alias.psoh push -u origin HEAD
alias.prune-branches !f() {     removal_flag=${1:--d};     git branch -vv | grep gone | awk '{print $1}' | xargs git branch $removal_flag;   }; f
alias.cop !sh -c 'git branch | fzf | xargs git checkout' -
alias.l log --graph --date=short
alias.stats shortlog -sn
alias.praise blame
alias.recent for-each-ref --count=10 --sort=-committerdate refs/heads/ --format=%(refname:short)
alias.overview log --all --since='2 weeks' --oneline --no-merges
alias.recap log --all --oneline --no-merges --author=<MY_EMAIL>
alias.testfest !f() {     tag=$(git describe --abbrev=0 --tags);     read -p "Continue with tag '$tag'? (Y/n) " -n 1;     if [[ "$REPLY" =~ ^[Nn]$ ]]; then tag=$(git tag | fzf); fi;     echo;     git log $tag.. --merges --oneline | grep 'Merge pull request';     echo "Listed merged PRs since '$tag'";   }; f

We use testfest to show all merged pull requests since the last release, but it also can be used to gather the release notes. 

Other tools

  • Fork Git client for Mac and Windows is useful for reviewing git diff and making commits. It is especially handy for selecting what kind of changes to commit when you don’t need the whole file. Most code editors have this functionality built in these days, but this one is super easy to use and is recommended by my teammates. Fork doesn’t support Linux, however.
  • GitSavvy is an awesome plugin for Sublime Text 3 users. Gitsavvy provides full integration with Git and GitHub, including basic Git functionality, inline diff viewing, along with status, branch, tag, and rebase dashboards. 
  • prepare-commit-msg git hook to automatically prepend a commit message with a ticket key from a branch name. This hook is especially useful when you need to check the related story in your project management tool (Pivotal Tracker or Jira, for example) to understand the wider context. When you have a story ID in a commit message, this makes it super easy to find. Here is the Ruby snippet that works on any machine that has Ruby installed. You need to make it discoverable by Git by linking to <PROJECT_DIRECTORY>/.git/hooks directory. Alternatively, you can run it with the Arkweid/lefthook Git hooks manager. 

#!/usr/bin/env ruby
ISSUE_PATTERN = /^\d+|\w{2}-\d+$/ # Pivotal Tracker or Jira project with two letters, as project short name
branch = `git rev-parse --abbrev-ref HEAD`
issue_id = branch.split('/').first[ISSUE_PATTERN] or exit
issue_id.prepend('#') if issue_id =~ /^\d/ # pivotal ids get prepended with #
commit_msg = File.open(ARGV[0], &:read)
exit if commit_msg.start_with?('[') # do not prepend if already there
exit if commit_msg.start_with?('fixup! ') # do not prepend if using commit --fixup
delimiter = commit_msg[0] ==  '#' ? "\n" : ' ' # only add newline if commit message is empty
File.open(ARGV[0], 'w') do |file|
  file.write "[#{issue_id}]#{delimiter}#{commit_msg}"
end
  • Fixup commit, mentioned in the above code snippets, is very useful for modifying already committed files. Just imagine that you have made some big story, and now you need to make some changes, and you make a commit, then another commit… And then you understand that you should have added some more changes to previous commits… Numerous changes will make a mess in your Git history. The best option is to make a fixup commit and then use interactive rebase with auto-squash
  • Integration with Slack. No more email notifications – use https://slack.github.com/, subscribe for reviews, comments, etc., and get all messages sent to Slack instead. 
Join our newsletterOnly the best content, delivered once a month. Unsubscribe anytime.

DevOps tools and approaches 

Deployment is another important part of software engineers’ work that can be streamlined. 

CI/CD – continuous integration and delivery 

CI/CD is an important approach that allows you to automatically validate and deploy your changes. When adding new functionality or editing something that already exists, it is essential to understand that your new commit works and won’t break anything. Continuous integration solves this problem. With a CI tool, a series of automated tests is run against new commits. If any errors are found, you get an instant notification.

Continuous delivery is the next step in this process: your product changes are automatically deployed in production (once successfully tested). Such an approach is crucial for apps that require constant daily updates. 

CircleCI is an awesome tool that supports integration with both GitHub and Slack. 

Linting

Always make sure that your code is properly linted. Linters check your code for programmatic and stylistic issues, resolving three types of problems:

  • Formatting. Every developer writes code in their own style, but when a team works on one app, it should look consistent. Linters help ensure compliance with idiomatic patterns (‘ or ‘’, line spaces, etc.).
  • Syntactical. Linters detect unreachable code that won’t execute. In the Ruby and JS worlds, such code can only be discovered during the execution, so here linters are true lifesavers. 
  • Complexity. Linters identify code that is too complex, such as having too many conditional statements, too many variable assignments, and so on. This way, you can improve your code and, as a result, make solutions that are more elegant and easier to understand. 

Linters are specific for each language – Rubocop for Ruby, ESLint for JavaScript, PyLint for Python, etc. 

Testing and automation 

Testing and automation are two essentials of software development. There are tons of tools and approaches that your and our teams use daily. Here I’m listing several small but super helpful tools that can make your life easier. 

Foreman 

This is free open-source software for managing servers. Foreman is helpful for automation of repetitive tasks (running all necessary processes with a single command, for example), but has an extensive set of features: 

  • Inventory management
  • Provisioning and servers discovery
  • Monitoring and reporting 
  • Content management
  • Numerous integrations

Postman and Insomnia 

Both these tools are equally good for testing and debugging REST APIs. They allow you to create shared collections with saved requests, which eliminates the need to keep remembering how to use each API. 

One of the use cases is writing automated tests and integrating them into your CI/CD pipeline (described a couple of paragraphs earlier). 

Shared collections in Postman

Mailtrap

Mailtrap will save you time and effort when working with email functionality. It is a full-featured online tool for safe email testing in development and staging environments. Setting your own email test server will take around three hours, while signing up for a Mailtrap account and integrating it with your app will take no more than three minutes. Integration can be performed via the RESTful API or as a regular SMTP. 

Our development team created Mailtrap after sending a batch of test emails to customers by mistake. Since then, we have been developing it to provide simple but effective email testing. The main features include:

  • email preview and HTML check
  • Bcc testing 
  • spam score
  • automatic and manual email forwarding
  • sharing your inboxes and projects with other users
  • dedicated email addresses for your inboxes

This way, you can safely test whether your email sending functionality works at all, view how the message content and variables are generated, share your testing results, and run automated tests. 

Test Your Emails Now

Several more helpful things

Pair programming

Pair programming is an awesome Agile technique that helps improve team collaboration, boost your hard skills, and enhance the quality of the product you build. Here is a great long read on pair coding published on Martin Fowler’s website.

One of the challenges of programming together is code sharing. For a long time, we have been sharing our screens, and it was annoying. Fortunately, there is a code sharing functionality in a couple of editors:

  • VS Code (live share)
  • Atom (Teletype)  
  • tell us if you know more! 

With it, you can share not just one file, but the whole project along with terminal. This way, you can really work together and even run tests. 

Laptop setup and updates

One of my teammates noted that macOS likes to be fresh, and tends to slow down after two or three major upgrades of the operating system, so he does a new install every year or two. A fresh installation means that you need to set a whole bunch of tools and their configurations that you use. 

There are at least two options that can help you resurrect your setup:

  • thoughtbot/laptop, a shell script that sets up a list of macOS, Unix, Heroku, GitHub,  image tools, programming languages, package managers, configurations, and databases.
  • thoughtbot/dotfiles, a set of vim, zsh, git, and tmux configuration files.

Alternatively, don’t forget about backing up your data or having an opportunity to return it when needed. For this purpose, we recommend using data recovery software that able to restore your data if something goes wrong.

Final words

Over years of experience, every software engineer has been creating their own set of time-saving and efficiency tools, depending on their projects and technology stack. In this post, I have gathered ubiquitous tools recommended by my colleagues at Railsware for delivering better results with peace of mind. 

We will be happy to know what you use in your everyday development flows and to discuss various solutions. Share this post on social media, and may the force be with you! 

Add comment

E-mail is already registered on the site. Please use the Login form or enter another.

You entered an incorrect username or password

Sorry, you must be logged in to post a comment.