An alternative title for this post would have been “F this, I am getting Git”. However, this is a cleaner option. This is a series on source code management. I would be sure to complement this with other related disciplines.
What I said
F this, I am getting Git– Me
That is exactly what I said all those years ago (in early 2013). I would like to address an invaluable subject that some software engineers often neglect. That is until it is too late to turn back the clock. I am referring to having a version control system.
This article is a throwback to the exact point I knew for certain that version control systems, were as crucial as having locks on your front door. A version control system makes sure you never have to go through the pain of losing your work. It is a backup of sorts.
Safety through insurance
When you lose your house through the fire, and agents come by your
house (oh you won’t have one now) the next day with a big fat cheque. You are all so pleased because you thought ahead about mitigating these specific risks.
Or maybe you have had to curse your stars because you accidentally deleted, or wrote over a piece of useful code. Well, it has happened to the best of us. And it can happen to you too. Similar to fire insurance you should also insure your code by having version control in place.
Before that fateful event occurred, it was not like I did not already know about Git. On the contrary, I had known about Git for about a year. I also knew about others like Subversion and Bazaar, which were popular at the time. There is just one thing. I did not have prior cause to ever be concerned about losing my work.
Just like fire insurance, no such event had previously occurred. The probability of this happening seemed low to zero. At the time, backing up code onto external hard drives seemed like a rule of thumb, at least among the circle of developers I knew. And oh, was I in for a shock!
On a fateful day, I was merrily coding. Also, I must mention that I always used shortcut keys whenever possible. They were time savers I said. My quick fingers mistakenly used a combination of shortcut keys in quick succession. In 5 seconds or less, I selected all, deleted, and closed an entire page of code I was working on. It was so quick I did not immediately notice it. Hence I continued coding, saved my work, and closed my editor. By closing the editor at that stage, and with no version control, I had now irreversibly saved my changes.
I then moved to the application view. It was behaving funny. Very funny indeed. I moved back to my controller. How surprised I was to see that the entire block of code was gone! Like puff into thin air.
I could not undo it. And I had made no prior backup copy ( or fire insurance in this case) of my work
All my work from the previous week (fortunately my project was only a week old) was lost, just like that. And then I said the words.
“F this, I am getting Git”.
What could I do next? I went through the five stages of regret and immediately did the only thing that could be done. I wrote the controller all over again! And most importantly, I used Git this time.
After all these years, I have continued to insist developers I collaborate with work save their code with Git. This has brought no problems whatsoever. Therefore, if you are reading this post, and have not started, then I can only ask what you are waiting for.
I am glad you enjoyed my post. Like, share, and subscribe for more content. Have a great day and goodbye for now.