Because many researchers work closely with the command line to run their analyses, managing and documenting scripts and workloads is key for reproducibility. We've all had those "Now what was that useful command I ran a few weeks ago?", "What does this line of code do again?", or "Uh oh, I accidentally deleted some code and now I have no way to recover it!" moments. Fortunately, there are many useful applications that were designed (primarily for software developers) to assist with writing, editing, documenting and managing your scripts, and to prevent many of those face-palm moments.
In this blog post we describe three helpful classes of desktop applications that you can use to better manage your research workflows.
First and foremost, anyone who works with code and scripts needs to have a good code editor. Code editors are essentially just text editors that have designed specifically for writing and editing code. They help you write code much faster, keep your code nicely formatted for improved readability, and can even help you identify mistakes or potential issues with your scripts before you run them! There are many different code editors available but here we will focus on two of the most popular and comprehensive editors: Atom and Visual Studio Code.
Technically you can write scripts with any sort of basic text editor such as TextEdit on Mac, Notepad on Windows or even Nano on Linux. The main difference with these text editors compared to code editors is that they often don't come with all of the added functionality that can assist with writing code (see below).
You might also think about using more powerful word processors such as Microsoft Word to write your scripts, but this can sometimes cause more harm than good as these apps can often add in special hidden characters that are not compatible with most programming languages and can break your code - see some alternatives for documenting code in the Note-taking Apps section below.
Both Atom and VS Code support a huge number of popular programming languages (such as python, java, R, perl, and even bash scripting), and come with loads of useful built-in features including:
- keyboard shortcuts (to make navigating your code much easier)
- syntax highlighting (to help you write your code correctly)
- version control via integration with Git (more on Git below)
- code suggestions and snippets (helping you remember how to do things)
- debugging (tools to help you find potential errors in your code)
- an integrated terminal (to run/test your code)
- and many more...
These code editors also feature an Extension Marketplace where additional functionality can be added via community-built extensions. These extensions give you the ability to do things like:
- automatically format your code based on the selected programming language
- auto-complete your code based on suggestions or snippets
- validate your code and check spelling
- enable automated syncing of your scripts to virtual locations (e.g. your RONIN machine or cluster) via SFTP/FTP
- export your code into other formats (e.g. markdown code can be exported to PDF files)
With over 30,000 extensions available for VS Code and close to 10,000 available for Atom, the extended functionality of these applications is almost limitless. While it can take some time to get used to all of the features included in these code editors, the time spent on transitioning to a comprehensive code editor such as Atom or VS Code is guaranteed to save you MUCH more time in the long-run. So what are you waiting for?
While code editors are great for working with scripts, sometimes you might just want to jot down some notes about your code, make a list of some useful commands or create some code documentation that you can share with others. It is great to invest a little bit of time getting into a good habit of documenting your workflows and adding notes about scripts and lines of code that you might not want to forget later on. You will be surprised how often you return to the same notes over and over again and thank your earlier self for being so helpful! That's why it is a must to work with a note-taking app that enables easy code integration. There are many applications that can assist with this but one definitely worth mentioning is Evernote.
Evernote is one of the most simple, yet powerful free note-taking apps that are available. In addition to rich text formatting of notes, organizing notes into notebooks and inserting pictures, attachments or web clips, Evernote also offers a very simple way to incorporate code into your notes:
Another bonus is that it automatically saves your changes as you go and can be synced across multiple devices. Overall, Evernote is a great all-rounder when you need an intermediate between a standard text editor and a code editor.
Git GUI Clients
For those of you who already regularly use Git for version control and management of your scripts (see this blog post for an introduction to Git), first of all, give yourselves a big pat on the back, and secondly, breathe a big sigh of relief because your life is about to get a whole lot easier. Introducing.... GitKraken. Just like how RONIN simplifies a whole bunch of complicated commands and AWS actions into some beautiful buttons for you, GitKraken does the same for Git. GitKraken provides an intuitive user-friendly interface for all of your Git needs and integrates seamlessly with GitHub. The GitKraken team even offer a great Git extension for VS Code! Of course there are many other helpful Git GUI clients out there, GitKraken is just our personal fav. If you have been putting off learning Git for your workloads, be sure to take that leap with GitKraken and we're sure you won't regret it.
Getting started using Git for version control can be confusing, but it doesn’t have to be. -GitKraken
These are just a few key examples of desktop applications that are extremely useful for researchers who work with the command line. We hope these apps can help save you a lot of time (and pain) and give you a well-needed productivity boost!