Workflow and Tool Development By drenwick on 2019-07-15 14:11:08

If you're a programmer, it's probably safe to say you've used an IDE at some point in your career. Perhaps it was a text editor such as VSCode or Vim that you heavily configured to work as an IDE, I'm counting that too.

It's also safe to say that you've probably used some sort of workflow tool to make development easier. Perhaps when I say workflow tool you think of project tracking tools such as Trello, Monday or Jira, or perhaps you think of CI/CD tools such as Jenkins or Travis.

Sure, these are workflow tools, but I'm talking about tools you more directly interact with in your typical development workflow. Version Control systems such as Git, Build systems such as Gradle, CMake, or Gulp.

For many of you, these tools likely save countless hours of work, by simplifying the build process, or allowing you to easily and efficiently share your code with your team.

But what else could we do? Perhaps you have a lot of boilerplate that a lot of your source files tend to include, or a standard template that gets used a lot. Would it be faster to create a generator script that would allow you to quickly scaffold new files? Maybe you're working in gamedev and you're spending hours hand-writing JSON files for all of the events that could happen in your game, could you make a tool for that?

I did, it saved me a lot of time:

Node-based event editor in Unity Custom Inspector

Something I've learned while toying around with the Unity3D game engine is to not underestimate the power of useful tooling.

Unity has the unique position of being very GUI heavy development. There's a lot more to gamedev than just writing the code. You need to create content, lay out levels, tweak parameters. Unity offers the UnityEditor API and Custom Inspectors to allow developers to create purpose-built, in-engine tooling to assist themselves or their team.

Without tooling, placing decoration around a map in Unity is an arduous task. Having to hand place each item, using unity's collision-ignoring transform tools to drag the object around its axes until it looks like it's probably sitting flush with the floor.

With tooling, you can create an asset placer, that uses raycasts and a configurable center point to easily and quickly place multiple assets:

Asset Placer by Mckenon
Unity Asset Placer by Mckenon

Unity isn't the only place where this kind of tooling proves useful, however. If you've worked in 2D gamedev before, you've likely used a tilemap editor of some sort, such as Tiled

As programmers, our entire mantra is to make our own lives easier, sometimes that means automating parts of our workflow. So next time you're working on a project, pay attention to your workflow. Maybe you're repeating some tasks consistently that could be automated, or that could be abstracted out to a tool.

Find yourself regularly pushing commits and then having to adjust issues affected by those commits? Use git hooks to automate it! For example:

GitHub will automatically close an issue if a commit contains the wording closed #3 or fixed #47. It will only do this however, if the commit is on the master branch, otherwise it will note on the issue that a commit referenced it, but will not close the issue.

In my case, I wanted to add a label in this situation to indicate that the issue has been resolved, but is awaiting a merge. This is a great way to show customers that their issue is fixed, and will be coming in a future update.

A simple after-push hook script can solve this quite easily, ignoring pushes to the master branch, and otherwise looking for the same issue-closing statements GitHub does, and using GitHub's API to add the label to the corresponding issue.

These are the kinds of workflow speed bumps we should be looking out for every day, and seeking to automate, or at least smooth over a little.