Writing Great Git Commit Messages; Why both ‘why’ and ‘what’ matter in a Git commit!

Mindlessly jogging in the web stream, I stumbled upon a post that pointed me to a good read detailing why ‘why’ matters more than ‘what’ in our Git commits.

TL;DR— the article explained extensively why ‘why’ matters more than ‘what’ since, “anyone can see WHAT you did just by looking at the code. But the code can never tell someone WHY you did it”, with an example Git commit going along the lines of “user should be able to see the card before editing it” despite the old way; “card view controller added”.

Albeit an enlightening read, it looked like it had missed few subtle annotations which could have drastically disrupted the way we would have typed our next Git commit. The author’s suggestion looked a little vague and it also sounded like something out of a User Requirement Document.

A commit speaks of a commitment of a developer to the project. It specifies a certain milestone and can be an addition or a change. Therefore, there can be instances ‘why’ doesn’t matter at all such as ‘added main template’ or even ‘added settings modal’ because they can be contextually insignificant during the resulting process. And also the little omission of ‘what’ wouldn’t work either since most of the times I look up on a commit is when I want to quickly know who did this change (isn’t that the whole point of it?) before asking why it happened. That’s what eye catches fast, ‘what’ of a commit before a ‘why’.

Therefore, as a solution to all, I propose combining both ‘what’ and ‘why’ for a better commit. A better way of saying the author’s example would be ‘added card view controller to enable user to view the card before editing’. With a single line, commit message talks about ‘what’ the dev has done and also ‘why’ he/she has done it. Easy, cleaner and straightforward than the default convention.

Happy Git-ing!

References- Gupta, S. (2017)- Writing Great Git Commit Messages

Life at Calcey

My Calcey Experience

A trainee software engineer recounts his first three months at Calcey
A fresh graduate, without prior experience, stepping into a work environment for the first time, I found exactly what I wanted most in a workplace, in the CHILLED OUT, FRIENDLY VIBE, that engulfs you the minute you walk through the doors. Friendly ‘hi’s, a welcome note from my interviewer himself and a casual dress code found me right at home from the start. All this and I haven’t even got to the Pool table!

DREAM workplace or what?

My interview at Calcey, was my first ever and walking in hardly knowing what to expect, I was surprised it lasted as long as an hour. Nonetheless, I enjoyed the deviation from the usual “Question and Answer’ format we have all come to expect of interviews and the test of my personal skills and talents instead. This showed me that this was a company that, not only, placed value on a person’s knowledge in a specific language or technology, but also their ability to swiftly solve problems, improvise and absorb new things. I was able to draw confidence from knowing their decision would be based on the talent and skill I showed, rather than ‘paper proof’- I never once had to take out my file of certificates and documents!

Joining a team working on a new project that had just kicked off, I found myself a little at sea initially working with a new technology unfamiliar to me. Yet the team welcomed me with open arms and guided me (bless these people) throughout the development. I even got the opportunity to sit in and be a part of weekly calls with the client, which was a great experience and invaluable exposure. I have learned through these calls the importance of understanding the end user. That in order to be a successful Software Engineer, one must go beyond the coding to build empathy for end users. To have learned this seemingly simple, yet fundamental, fact so early in my career has shaped my way of thinking and approach in a way that, I believe, could prove to be invaluable to me in the future both professionally and personally. (The world needs more empathy!)

I’ve now been given the opportunity to work on another new project, with two other trainees just like me, where we are allowed to develop independently. Just kidding, we get help from the seniors when we’re stuck!

I would proudly call myself a product of Calcey, for the experiences and technologies I am exposed to here. They, together with the people and their constant support and guidance, are molding me into a better developer than I could have ever imagined 3 months ago.

Photos by Jan Michalko