In the age of data privacy and security, we’ve heard a lot of people talk about open source applications! especially in the last few months! in the ongoing wrangling controversy regarding Facebook and Whatsapp we’ve heard people talk about moving to OpenSource alternatives like Telegram and Signal! So what is OpenSource?
“Opensource is as less ‘business’ as it gets to writing code”, you are the developers and owners of an app that otherwise would be controlled by a private player! Open source is the democracy of apps. It is by the people, for the people, and with the people in every sense possible! enough jargon let’s head onto some real-life examples…
Many apps like Microsoft Office, Microsoft Windows, Adobe Photoshop, Premiere Pro, Facebook, etc. are developed and owned by private multinational companies like Microsoft, Adobe, Apple, Facebook Inc., etc. The source code of these apps is solely controlled by the parent company and is not available to the public! Most of the time these apps collect a lot of data or are accessible only after you pay a hefty price! Normally you never know how these apps work under the hood, you only know that they get the job done!
On the contrary, there are some apps like VSCode, Android, Brackets, etc. whose source code is available for the public to see, learn, modify and even contribute to! There are also open-source programming languages like Kotlin and Python, and open-source development frameworks like React and Angular!
Enough with the examples, what actually is Opensource?
Software being open source means that not only is all of its source code available to download and view publicly, but it is also available for anyone to modify and even use in their own projects!
Both the Chrome browser by Google and Edge by Microsoft are based on an open-source project called chromium which is available for anyone to read, document, modify or even develop upon, and be released as a new browser! Who knows you could build the next Google Chrome that’ll rule the future of browsing!
Is it as difficult as everyone makes it out to be?
Contributing to someone else’s codebase could seem daunting at first! I mean, come on, we can’t even solve bugs in our own codebase, how can we ever think of solving issues in someone else’s program? Well not necessarily, You will be considered as a contributor even if you add, remove or modify a few words in their documentation! In fact, many open source developers start their opensource journey by modifying the README file, which is the first thing you see when you open an opensource repository (aka. folder)
So where is all this code hidden? There can’t be a centralized location where all the source code is stored and can be accessed at a whim! Well at least there isn’t an industry standard, but that being said most of it is done on GitHub! There obviously are other git-based alternatives like GitLab and Bitbucket, but GitHub is currently the most popular open-source platform out there, and is very easy for beginners to get started with!
Quick fact: it is interesting to note that GitHub has now been acquired by Microsoft
So how does all of this work? Say Hello to Git!
If you’ve tried to work on a project with your friends, you might have realized how difficult of a task it is! Let’s understand why we want Git in the first place with the help of a story — Let’s assume you have to work with Adam on a project. You decide you will develop the first half and once you’re done, Adam will complete the rest! Once you complete your part of the work you share your codebase with Adam. Adam copies all the files to his desktop and starts working on them. Halfway through Adam’s work — while you were slowly relaxing into your dining chair to retire yourself to lunch, a new idea pops up in your mind! you start adding that idea into the project and share the updated codebase with Adam! But Adam happens to have completed half of his part using the old code you shared with him earlier! Now he has to start working all over again on the updated codebase that you shared with him!
Now let’s assume after a lot of fist throws and hurling of words at each other, Adam finally agrees to start working all over again on the updated codebase. Now, After a few cups of coffee, you realize, the added feature is quite difficult to understand for new users and it also makes the project a bit too complex! You want to go back to the stage prior to adding the new feature! How can you achieve this? How can you make the change so that Adam’s work is not affected by your highly ingenious mistakes?
Isn’t Adam working on a different part of the project, why should he be disturbed by your dubious qualms?
Now it’s 2:00 am, you decide to go to bed at last. As you are wrapping your legs around your blanket and grabbing the pillow and pulling it under your head, slowly drifting into your own dreamland — suddenly you realize you forgot to add a really important feature, and thumping back to the bed, reality hits you in the head and forces you back to your miserable life! (jk:p)
The next day you somehow gather your courage and discuss the matter with Adam, Adam finally loses his cool and you start wrestling with each other.
So how can you address all these problems, and make working in teams a lot more fun? How can you make office spaces a lot more creative and rewarding, and stop workers from wrestling with each other over project deadlines and bottlenecks (like you and Adam?) Now, In the middle of your wrestle mania match with Adam, a third friend Sylvia comes up and suggests a very viable solution— “Why don’t you try Git?”
What is Git?
Let’s start by writing down the problems we encountered earlier while working with Adam on the shared project!
- You cannot start working on your part of the project until your partner finishes with his!
- The other person will have to start all over again if you wish to add some code changes to your already shared code!
- You cannot just roll back to a previous stage of your code if something goes wrong!
- We lose track of the previous stages of your code as you add new features and modify existing ones!
Git solves all these problems using the git workflow! So what actually is Git? Git is a version control system! nothing more, nothing less! there are commands in git that allows you to save your work at a given point of time (which looks like timestamps for your code), create different branches and work separately on each branch and merge them together later, or even revert back to an earlier version of your code with a single line of statement! Although it is out of the scope of this article to explain every git expression, the good news is you don’t need to know every git command out there to get started! Just understanding how git works and maybe knowing about 2–3 simple commands is enough to get started! I will soon write another article about git commands you need to know for getting started and link it here.
Getting started with Opensource
Step 1: Make an account
A good first step would be to make an account in any open-source platform, a good one to get started is GitHub, but you could start with any other platform like GitLab and BitBucket. Once you create an account, try to navigate around the platform and find good repositories. You could browse through their code most of it would feel like gibberish at first, and trust me sometimes it took me a while before I got used to their code and I started understanding at least a part of it! You don’t need to understand every part of the program! understanding maybe one part of the codebase, where you can think you can fix an issue is more than enough to get started!
Step 2: Fork a repo
Now you need to create a copy of the repo, which is also known as forking the repo. It is important to fork a repo so that we can experiment with changes without affecting the main codebase, and only once we are confident with the changes we can then push the changes to the main code base and request a review! If you didn’t understand a word I wrote in my last sentence, that’s completely fine, you will understand it once you get your feet wet in opensource!
Step 3: Clone the forked repository to your desktop
The final step is cloning the repo to your desktop. You can either download a zip file of the repo and open it on your desktop or use the recommended way of using the
git clone command. To clone a repo, open the terminal, and navigate to the location where you want to clone the repo. Then use the
git clone repo-url command to clone the repo to your desktop. Every repository has a unique URL, use this URL in the clone command to clone the repo to your desktop! This is the easiest and final step, git will take care of everything required to download the repo from the cloud. Once complete you can open the folder and browse through the code in your local desktop environment! Play around, get to know the code, and modify stuff to see how it reflects in the app!
Was this difficult? Well maybe at first but you will soon realize the merits of working in open source and how stuff works the way it does currently! Till then happy coding:)