My workspace has a mini-kitchen area used by colleagues that come from across the globe with a variety of upbringings. A shared sink, toaster oven and a microwave that we all use when brown-bagging. Why mention this? This area serves as a metaphor for my opinion on writing code on a team.
Comment, comment, commenting
At times on approach, the sink has mugs, coffee grounds, dirty dishes with caked on food that has sat for days, the forgotten orphans of a rush project. Like commenting code, no one wants to clean up someone else’s mess in the kitchen.
As creative or technical professionals, we often collaborate via processes like Agile or repositories like GitHub or in a myriad of local environments that require we work on someone else’s work or them picking up on yours.
Create a staging environment or work in a repository
While crunching on a recent project that was in production, six rounds of changes were overwritten when a team member’s admin (with changes from the day before) were saved, erasing mine. On deadline, this could be catastrophic.
TIP ONE: Avoid issues by working in a staging environment or repository locally. This affords a back-up when collaborating and version control.
Follow the breadcrumbs
I tend to add comments to provide a trail for me to follow out of the code forrest if I get lost. I’ll try to work out ideas or problems but sometimes you’ll need to backtrack out when the result isn’t what you want.
I add comments on what the desired effect should be, when I made the update inline and add a date on commit to a repository or update. Be as detailed as you can because the moment quickly passes into to memory and these comments are the clues a code detective needs to solve a mystery you’ve spent hours on.
TIP TWO: Add comments on what the desired effect should be, when the update was made and on commit to a repository or update. Be as detailed as you can because the moment quickly passes into to memory.
Call me ‘Captain Obvious’ but although these tips are basics, you’d be surprised how many people don’t use these techniques. More than ever the tech economy’s workforce are independent contractors working solo or joining a process so have good “home training” makes everyone lives easier.
I’d love to hear how you work and what your best practices are.