Don’t remember what you’ve learnt through an online course after couple of days? Git might save you.
Tags: Git, Remembering, Code Newbie

Are you a beginner struggling to learn how to code and often forget things you’ve learned and lose motivation to move forward? Then please continue reading!

I know exactly how it feels to take a 40+ hours course like HTML CSS or Javascript or React js or any other course and completing it with the course projects and then forgetting the content after couple of days.

Trust me I’ve faced it. I used to invest a lot of time learning best selling courses on Udemy which are over 30-40 hours, and completed the course projects as instructed which used to boost my confidence and then, after couple of days, I didn’t remember anything from the course when I tried to apply the same knowledge in my projects.

Well, we’re human beings and we tend to forget things which is normal. But the time we invested should not go waste. After some experience, I learned the hard way to remember things or retrieve the concepts quickly even after forgetting everything. My key tool to solve this problem is a version control like git.

How to complete a course effectively?

This is what I do. I first see the best selling course on Udemy and review it a bit. After feeling that is the right course, then I start the lectures and code along with instructor. This is the first key point. Coding along makes us so much better than just watching the videos. By just watching the videos, we often think we got a good grasp on the concepts but actually we don’t if you ask me. Watching the same video twice might sometimes help so much but that is not it. There is more! Before you start learning a concept, make a github repository and give a meaningful description. Then start watching the videos and code along with the instructor, and once you feel comfortable understanding the concept, push that code with a commit message that you can understand and later retrieve it.

Commits on git is the key take away from this article. There is no hard and fast rule as to how your commits should look, but my recommendation is, your commit should be a task. A simple task. Let’s say you’re learning HTML CSS and instructor shows you how to design a button. He might teach you the properties like applying background-color, margin, padding, box-model and so on in a lecture. After understanding them, now say it to yourself that “If I were to look for the same info in the future when I am designing a button for my project, how do I retrieve all this info without having to watch this video again?” That’s possible by dividing the info you have just learned into multiple commits. These are the commit examples I would like to follow:

write this below code first

<button class=”btn”>Click Me</button>

.btn{

background-color:’blue’;

/* this property gives a background color to the button*/

}

Now commit this with a meaningful commit message

git add -A

git commit -m “designing button — applying background color to button”

Let’s add margin and padding to this button.

.btn{

background-color:’blue’;

padding: 5px 20px 5px 20px ;

/* padding is the distance between content and border. top right bottom left . This can also be written as 5px 20px, meaning topBottom leftRight*/

margin:20px 10px;

/*It adds top & bottom 20px and right & left 10px*/

}

Now commit this again with a meaningful commit message

git add -A

git commit -m “designing button — applying margin and padding to button”

Why is this method effective? You see, after couple of days when you want to design a button yourself and have no idea what you had done before in the course, then scroll through your project commits in github and you’ll find the commits prefixed with “designing button” so you know where to look for.

Advantages of this approach:

Maintaining clean code with lot of comments which gets you going next time

When you apply for next coding job, it’s more likely the hiring team would look at your commit history and know how effectively you maintain the code

Your commits itself will teach you designing the whole project next time

No need to go in search of all the tutorial videos which you have forgotten long back. Though you don’t remember all the content, you have all the commits which explain you what you had learnt

As an example of this explanation, take a look at one of my course projects I am building in my git repo. This is from Advance CSS course on Udemy by Jonas https://github.com/sandeep194920/natours/commits/master

Conclusion

We learnt that it’s always important to maintain a good commit history with meaningful commit messages in git with self explanatory comments so that we don’t lose track at any point of time and thus don’t lose motivation in creating or developing beautiful things. Ultimately, nothing should stop us from what we want to develop.