Writing Code as A Team
Software is rarely written in a silo. Whether you’re building the next social media app for mimes at some SF startup or maintaining a legacy system for a faceless company in Idaho, you are almost certainly working on a team. But working on a team and being a team are different things. It’s entirely possible to have a team of individuals, basically rogue coding their way through tickets, cohesiveness be damned.
But, Why Does It Matter?
There are two developers, Abe and Lenora (John and Sally were out that day), working with some data from an API that requires formatting dates to display on a graph. They are both using the ubiquitous JS library for handling dates, MomentJS, but in wildly different ways:
Lenora abstracts her logic to a clever helper class with a function to format the Unix based time format to local time based on the user timezone which is stored in the front end app in local storage. Not bad Lenora, not bad at all.
Abe has a similar need but he opts to format the dates directly in the file that constructs the chart and does not take user timezone into account. Dates, amirite?
Without a thorough code review, both these pieces of code make it to the master branch and they work… for a while. Just after Halloween, when Daylight Savings ends, customers begin noticing that some…