jay's old blog

this blog will be deleted soon - please visit my new blog - https://thesanguinetechtrainer.com

Version Control and Git – Part One

Despite being a developer for a long time now, I ignored version control at my own peril. That is not to say that I never felt the need for version control. In fact, even way back when I was building my own code for my final year project (It's funny that even in a big college like SJCE where I did my engineering, most of my friends were content to just pay for their final year project and just let it be. If my sources who will remain anonymous will confirm, even today this trend of buying the final year project still continues to be the norm in most engineering colleges which is straight out sad but is a story for another day) I felt the need for version control.  

Essentially, this is what I used to in my earlier days of development. Suppose I am building a simple calculator. As always, I would go ahead and design the entire project using a combination of notes and drawings. Once I am happy with my design, I will take a break and then redesign things after running it through some use case scenarios (which are once again drawings filled with flowcharts, user inputs and outputs). After the design is finalized, I will break it up into stages and then start building the software. 

Now, here is how things can go horribly wrong. Suppose I complete building the stage 1 of my calculator. Everything is working fine, and testing is complete and I am extremely happy. Then, I start work on stage 2 and then I add some new code. Boom and Kaboom, the application is no longer working. Further, I cannot remember all the changes I made. Which means, not only is stage 2 out of the window, all the good work done on Stage 1 is also gone. Essentially, I have no other way but to start from scratch.  

Now, after something like this happened a few times, I decided to do 'crude' backups. What I would do is go back to the solutions folder (or the project folder) and then compress Iit. Give it a name (usually a combination of the date and time of compression) and then proceed further development. This way, if something goes wrong, I have back up and that means, I don’t have to start from scratch.  

So, suppose my calculator projects has six stages, when the entire project is completed, there would be six compressed folders. Each of them representing a fully working 'stage' of the application. In other words, each of these compressed folders are 'versions' and I am able to control the development of the project. Control, in the sense that, if something were to go wrong (and in software development something will always go wrong), I am still in control of the project. So, we could say that is 'Version Control'. 

The whole compressed folder thing is a very crude form of version control. While it prevents complete destruction of the project, it is version control in its most basic level. It does not help me in any way to collaborate with my friends.. It does not help me keep track of changes. Also, the entire process of zipping folder is time consuming and not the most efficient way of doing things. Then, if you want your code to be safe, you will have to manually upload it a cloud storage.  

The solution to that is Git, and we will talk about that in the next post.

Follow me on twitter, facebook and instagram for more updates. Thanks!


Comments are closed