David
Blue Collar Dev

Blue Collar Dev

Best Tools ๐Ÿ› ๏ธ for Different Coding Workflows

Best Tools ๐Ÿ› ๏ธ for Different Coding Workflows

David's photo
David
ยทSep 29, 2021ยท

3 min read

Subscribe to my newsletter and never miss my upcoming articles

When writing code I often find myself using different tools depending on the workflow I'm currently in.

In some workflows, like fixing a bug, understanding the code is most important. In other workflows, like implementing a new feature, my focus is more on writing code.

Here is an overview of my main workflows and which tools I use the most.

New Feature

When implementing a new feature, my focus lies on writing code. I want to write code as smooth and fast as possible and avoid distractions and context switching.

I use PhpStorm as my IDE. Since I'm already familiar with JetBrains IDEs and was not able to setup all the PHP plugins for vim correctly, I'm OK with it, although it's resource-intensive and could be a bit faster...

Of course, I'm using the IdeaVim plugin to make the editor feel more like home.

Also, I like PhpStorm's auto-completion and the database integration, which avoids another context-switch.

Because I'm using Laravel, I can usually generate whole files with the php artisan make command, and then fill in the methods:

$ php artisan make:controller CustomerController

At our company, we customized the stubs so that the generated code complies with our coding standards.

For example, we always use strict typing in our code base. So we put declare(strict_types=1); at the top of the stub files.

Interconnected Feature or Change

A slightly different workflow is when I'm having to change an existing feature or add a feature, which has lots of dependencies to the rest of the code.

Then, my focus is a bit less on writing code and more on understanding existing code. For this, I use PhpStorm's "goto definition" and "find references" features.

Another tool, which we recently set up at our company is Sourcegraph. It's a search engine for code for your whole organization.

This tool was a game changer for us, because it makes understanding code, especially over different repositories, so much easier.

Another important part in this workflow play unit and feature tests. Luckily, we have a high tests coverage, so I'm constantly running the tests to see if my changes break something.

Thanks to paratest, Laravel can execute the tests in parallel, so this process is very fast.

Bug Fix

I find bug fixing a very different workflow. Writing code is less of a priority and understanding the code is key.

My favorite tool here is Sentry. It is extremely helpful for fixing bugs. Not only are you getting notified when an error occurs, but you also get detailed information about the environment and the inputs which lead to the problem.

After I'm having a good idea how I can reproduce the bug, I use Docker, Git and composer to set up my local environment to exactly mirror the production environment.

For debugging, I use PhpStorm's built-in debugger. The "Evaluate expression" feature (Alt+F8) is especially helpful.

I typically finish up with writing a test case which checks the bug fix.

Code Review

Code review is about understanding code, so I use the search features in PhpStorm and Sourcegraph a lot.

After I understand the pull request, I comment on it in BitBucket. BitBucket also shows the results from the pipelines, which runs the tests and linters.

I find the user interface of BitBucket pull requests slow and lacking in many ways, but haven't found a better way to do code reviews.

๐Ÿ‘‰ Which tools for code review can you recommend?

Architecture and Documentation

Another very different workflow is designing or architecting a new feature. During the actual work, I mostly resort to pen and paper.

To communicate my ideas afterwards, I draw diagrams in draw.io, describe them in markdown files or Word and present them in PowerPoint.

I also looked at Structurizr, but did not really start using it, because it is a bit more complicated and less flexible compared to draw.io.

๐Ÿ‘‰ Overall, it works, but I'm not super happy with the tools in this category. Can someone recommend better ones?

ย 
Share this