Featured Post

BUILD A TODO LIST IN PYTHON

Image
Build a TODO List in Python Overview The objective is to build a todo list to which we can add items, remove the added items, edit the items and even if required, delete out the entire list itself. We will learn here step by step, how to build the todo list with the above  CRUD (Create, Remove, Update/edit, and Delete ) features.  This is a CRUD list  app  that we are building as we can Create, Remove, Update items in the list and Delete the entire list itself. We will be using Python3 to build this Project. Importing os and time We import time to let the screen pause for a while before clearing  and we import os to clear the screen . Initializing the list We initialize the todo list with an empty list as there are not items added yet to the list and this is represented in the code aby using an empty square braces   toDoList = [] Defining the print list  The def keyword is used to define a function in python. In the below code, we define the function called printList(). When we define

How to remember code in your learning phase

How To Remember Code In Your Learning Phase




How to remember code is the biggest fear factor in every beginner's mind when setting off to learn Programming. You may heard some friends or colleagues brag that " Oh, I could memorize code so fast and very easily , as I have a sharp memory !" After hearing this many times in a row, you tend to get disappointed or even slow down in your learning journey and some learners may even give up learning to code. Now, let me tell you, please stop listening to others' brag stories and just focus on you as a learner while learning to code. Just compare you to yourself and no one else! In this article, I will be providing you with enough tips and best practices to strengthen the process of your learning journey and you will then realize that it was a waste of time looking at other learners' learning process.


DOCUMENT EVERYTHING

There are different ways to document code, and given below are pointers to document your code.

Write down everything

The art of writing down everything in pen or pencil has long been forgotten with the advent of online learning but it is interesting to note that writing in a traditional format is still the best way to retain the memory cells in your brain! What exactly you need to write Important concepts while you are learning a coding language and also the code snippets for the concepts. 


Make hand written drawings or diagrams

Another practice you must keep in mind is to make drawings or maps or diagrams whatever you feel comfortable with, to jot down the overview of the coding lessons. For example, you have learnt the concept of looping in JavaScript, then, you need to make a diagram with different types of loops like for loops, while loops and if-else loops etc and make the diagram with an objective in mind to summarise the concepts. While making the diagram for the loops, just ensure that you write down different scenarios when you are supposed to use the for loop, or if-else loop or while loops, and this must be reflected clearly in your diagram. This way of learning diagrammatically, would ensure that you get a visual map in your mind and visual maps are excellent way to stabilize memories in your mind and brain. It also helps you to focus better and establish a solid foundation of the concepts and methods in your coding lessons and simultaneously, it ensures that you have established a core foundation and also an awesome pictorial version to come back to , whenever, you get stuck in your learning journey.


Save your code with notes in Github repositories

Open a GitHub account and start creating repositories from day one of your learning journey.  Repositories are useful in not only reiterating what you have learnt but also serves as code documentation to help attract prospective clients or employers. 


Code Snippets in cloud editors 

Replit is a good online or offline code editor to practice all your code snippets and check how it works. You can see immediate results when you code in an online editor .


Make cheat sheets 

It is not possible at all times to remember or retain each and every concept of coding in any programming language for that matter and sometimes when you are doing a very important project, it is possible that you get stuck and can not move forward because you forgot one of the most common concepts. In that situation, if you had carried your cheat sheet with you, then, you could have easily looked up your cheat sheet, for a deep reference and get started with your project. Now, you must be wondering, what is a cheat sheet? 

Don't worry, if you are hearing this term for the first term in your life, you are not alone! Even I did not know what is a cheat sheet until I started coding. I used to think that it is some kind of sheet with notes to cheat in examinations as I have some of my classmates cheating in examinations using such sheets, but, here, we are not referring to such cheat sheets :-)

Here , in this context, a cheat sheet is purely a sheet of paper where you jot down important concepts in short, while you are learning the concepts, for the sake of future reference that you could refer to whenever you get stuck in doing your coding work. A Cheat sheet could be either manually hand-written sheet or it could also be typed down as small notes on a word page and then stored electronically on your computer or phone or even printed out and filed in an arc file for your reference. It could also be done as a slide and later on, you could make a carousal of slides with lots of concepts and references on different slides all linked to each other , forming an awesome cheat sheet for that particular programming language.

Some examples of cheat sheets could be notes on JavaScript Arrays, Python Loops, JavaScript Functions etc.


Find Cheat sheets

Aside from preparing your own cheat sheets, you could also find others' cheat sheets from popular platform communities that share cheat sheets, such as LinkedIn, Twitter and Facebook groups and communities for that particular coding language that you are learning . Some cheat sheets are available for free and some are available for a price.


PRACTISE PROJECTS

Nothing can beat projects since practical knowledge is only derived from projects and it's not possible to retain code just by learning concepts and theories. Start from mini projects and go on to do intermediate and advanced level projects. 


DON'T LEARN, UNDERSTAND IT 

When it comes to coding syntaxes, it is a common myth and practice to commit to memory, all the syntaxes. This is the biggest blunder most programmers commit and this is to be avoided at any cost! Do not waist your time on putting pressure on your brain to memorize the syntaxes!  You are supposed to focus on understanding the basic concepts surrounding the code. 

For example, if you want actions on your JavaScript web page, do not memorize the different code to make your web page functional using different events, but, on the contrary, understand , what are the different event functions that trigger an action in your JavaScript web page. Understand what is actually happening when you type a certain code for an event. When you understand a code and then do the project, or type the code, then, automatically, it will be stored in your brain and it becomes easier for you to retrieve it from your memory when you try to recall.


LOOK UP DOCUMENTATION 

For every programming language, you will find their respective documentation online. For example, Python documentation could be found at python.org and JavaScript documentation could be found at MDN Web Docs and so on. Other than these documentation sites, you could also find programming documentations at GitHub repositories by looking up repositories for the respective languages. If tiy search for the respective docs on GitHub repositories, you will come across the required documentation, for example , if you search for python docs on GitHub repositories by clicking the search icon there, you will find the python-docs on GitHub there as well. This example I am providing you here so that you could access the above documentation on GitHub and see how it looks like when resting on a repository.


THINK LOGICALLY DON'T MEMORIZE

As you proceed to learn a programming language, you will feel tempted to learn the code syntaxes and commit them to memory. This is the biggest mistake that beginners do while in their learning journey because trying to memorize will actually pull you back few steps backward! The learning phase needs to feel effortless and this is only possible if you make 'understanding the ground facts' one of your essential learning tools. Understand the logic behind every coding concept and understand why that particular syntax is sitting there on your code. 

For example, when you use the 'if' condition for JavaScript or Python, you need to understand why the 'if' loop is used. This condition is used in a situation when there are several cases or choices and different actions or results are expected to happen for different conditions. For example, think of a situation : if your age is less than 18, you cannot vote, but if your age is more than 18, then, you can vote! Now try applying this in both JavaScript  code syntax.


const age = 13;

if(age > 18){
  console.log("You can vote!)";
}else(age < 18){
  console.log("You can not vote!");
}
In the above code, you can see the flow of logic that will help you in remembering the syntaxes. When the age is more than 18, the code says, you can vote by using console.log and if you are less than 18, you can not vote. In both the cases of the ages, the console will show you different results. 


In the case of python code, it would look something like :


if age > 18:

  print("You can vote!")

else:

  print("You can not vote!")


You can see the same code logic in python code, just the syntax is a bit different in that, here, it says print instead of console.log

So by getting the concepts right in one language, it is easy to get it right in another programming language, except for remembering some basic code syntaxes, but, it is easy to remember once you start following the learning methodology that I am writing in this article.


MAKE A TO DO TASK LIST

This is to make sure that you are also documenting at every stage, what you are learning and what you have covered step by step. By doing this, you reiterate your learning . At every stage, you have to fill up your to do list to make you keep motivated as well as keep you going to your goal even faster than you aspire.


MAKE COMMENTING BEFORE YOUR CODE AN ESSENTIAL STEP

Commenting is a common practice while writing code to make sure that the commented code is only visible to the programmer and not the end user. Also, the idea of commenting is to enable the programmer to note down why that code snippet was used in its place and this way even if a new programmer comes along who didn't write this code , he will be understand why you wrote that code and it's result there. So, if you keep writing comments on your code, you will be able to retrieve from the code in case you forgot yourself after writing the piece of code. It's normal  for us to forget our code when we come back to it after a gap but the comments will help us to remember or recapture why that code is sitting there.

You can comment in JavaScript  by writing two backslashes in front of the note and in Python,  it is done by writing a hash symbol before your note. 
Let's take an example:
in the above JavaScript code snippet, we use comment example as follows:


const age = 13;
if(age > 18){
  console.log("You can vote!)";
}else(age < 18){
  console.log("You can not vote!");
}
Commenting in Python:
#if-else condition
if age > 18 :
    print("You can vote!")
else:
    print("You can't vote!)


Commenting in JavaScript:

//if-else conditional statement



EXAMINE REAL WORKING PROJECTS

It is a good idea to browse real working projects and examine the code behind all the projects. You can look up GitHub projects done by other established programmers and it is definitely a good idea to inspect the code in order to understand the code, but, not to copy the code! 

You need to break down the code into different segments and then understand. Understand what each piece of code is doing there and I am sure, you will find lots of comments there for every code snippet and that is going to help you on working on real projects before you proceed to do your very own working projects. If you have no idea how to inspect code, let me tell you how to do it: all you need to do is, go to a website that has been either found through GitHub repository projects or some website that you find online and just right-click on the site after which you will find, the command, 'inspect' . Just click on inspect and you will be forwarded to the source code of the site concerned. Ensure that you are not tempted to copy paste the code, just keep examining each of the code snippet and you will be on your way to prepare yourself for the real Programmer's learning path! One example of a real life project in React.js is this project.


REPLICATE & IMPROVISE OTHERS' CODE

It's a good idea to replicate expert programmers' code if you can improvise upon it and give it your own unique twist. For example, let's say you search for the source code for building a drop down navigation menu. Once you find the appropriate code, you could use the same code as your inspiration to build your own version of a navigation menu by improving the design and features, it could be in terms of styling it with CSS or better still give it your twist by changing the top nav menu to a side menu . You could even make it better by making it responsive across several devices, be it. mobile phone, tablet, laptop, desktop etc. You could give credit to the author of the original source code and after improvising this code, you may add the code to your GitHub repository with mention of what you improvised on the original code. This will ensure that the author of the original code will thank you for this and not feel that you stole the code. This is a cool method of practicing coding while learning from other people's code. The best place to follow this practice is by looking at other GitHub repositories and improvising their code by adding some changes and mention the changes in your repositories. 


LEARN, RE-LEARN, UN-LEARN 

Committing to memory includes not only learning but also re-learning and un-learning as well.

For example, it is possible that we forget the concepts that we learnt in the initial learning phase , but, it is ok to go back , revise and re-learn the same concepts and you will realize that while learning the same concepts or topics second time or several times repeatedly, it becomes much easier to commit it to the mind and memory. 

When you learn your second programming language,  then, the process of un-learning and re-learning also really helps. For example, after learning, Python, if you attempt learning JavaScript,  you may need go re-learn some concepts such as arrays, objects, loops, conditional statements and if-else loops etc, however, you may need to un-learn some practices such as using semi-colon after every code , since you don't need to put semi-colons in python. I used to have this annoying habit of using semi-colons in Python because of the hangover I had with semi-colons after using it generously in JavaScript and finally I got rid of this habit by re-learning the codes of Python otherwise it could lead to a messy code output of mixed-up Python and JavaScript code! If you hate the idea of learning multiple coding languages and the thought just creates tention in your mind, then, you may  get some inspiration for learning multiple Programming languages from this post.


100-DAYS OF CODE SNIPPETS OR PROJECTS

Doing 100-days code projects help you to revise your code while enabling code drilling into your brain! 
100-days coding also leads to a consistency  in your coding habits that could go a long way in  building your code memory.👏 Moreover,  coding for 100 days leading to doing 100 different challenges instigates the mind to challenge the brain to learn faster as boring things are more difficult to remember but challenging things are exciting and motivating to remember. Also, doing the 100-days coding, gets you into a consistent coding habit that is so important for a Programmer, as, it is very common for you to forget code and concepts, if you are not consistent in your coding practice.



ADOPT REPETITION CYCLE 

Repetitions always help us to remember and reiterate things in our mind effortlessly. It is a good idea to try out the repetition cycle strategy while you are involved in learning code in the beginning of your coding journey especially, when you do not have the required coding expertise or appropriate work experience in playing around with code syntaxes and problems. 

Let's see how to practise this strategy. Presuming that your first programming language is Python, and let's say that you started learning the basic code syntaxes of Python3. You will be most likely to start learning from the concept of Variables. As we all know that variables are containers that are used to store data and this concept of variable is similar across different programming languages , not just Python. But once you read the basic definition of variables in Python and then you start doing some examples to get to know variables better, then, it is likely that you are going to forget it after a week or two , if you just read once and just practise once. So, abiding by the principles of repetition cycle, what you would do is :

First read the definition of variables, then understand it further by looking at various examples of variables cited in the lesson. For example, if you assign a value to the variable, let's call the variable, name, and then assign a value of "John" to this name variable, then, we have a code syntax like this:

name = "John"

So, here, we are storing different values for names in the name variable. One of the values happen to be "John"

In order to read the output, we use the print function, so, we write below

print(name)

In the output, we will see John

So after doing it once, what you should do is, to do the same exercise and one more exercise by repeating the example above , the following day and try and see if you can remember doing it. If you get stuck, you can refer to the example that you did the previous day. You are supposed to repeat this cycle at least 3-6 times, by different methods, either in different hours of the day or in different days of the week , depending on your convenience and time available as per your time schedule:

a)writing the code manually on paper with a pen or pencil

b)coding on an online code editor like jSitor or repl.it

c)making a cheat-sheet either in a note book(recommended) or loose paper sheets, with clear hand-writing. After you complete this repetition cycle, you will find that this code syntax and concept as well are so well grilled inside your brain cells that even if you want to forget, you will not be able to forget it!


REFRAIN FROM  FORCIBLE CRAMMING

Another important point to remember is that you should not try to force yourself to remember things especially code syntaxes as it is possible that you will forget it sooner if you pressure your memory. Just like our physical body, our minds also get tired under pressure and it needs rest and peace before doing more work and stress is a major leader in damaging our ability to think, focus and retain things in our memory. So, if you try to stress your mind to commit to memory, you will only forget even more. 

Hence, it is a good idea to just remember what is being absorbed into your mind with the given logics and the rest of the stuff will be absorbed gradually with more practice, patience and consistent perseverance.

Try to remember your childhood days when you tried to remember all the letters of the English Alphabets. It was such a herculean task, and I still remember, I just could not remember letters starting with loops or semi-circles, such as P, B,S,O . As a child I had the same issue for numbers and I found it really hard to remember and also write down the numbers, 8, 9 and 3. My teachers would punish me by delaying my lunch time and keep the food near my table but not give it to me until and unless I got it right. It was their way of punishment and rewarding strategy to teach kids, but, when I became a teacher, I would resort to a more peaceful technique to teach numbers and alphabets. I would use the concept of logics to enable the kids to remember! 

For example, if you need to write 8, you need to write two zeros that is two 0 one below the other joined together. If you need to write 9,  you just need to write a 0 and then extend it downwards with a vertical 1. If you wish to write the figure 3, all you need to do is half zero one below the other. Similarly, even for coding, you need to apply tricky simple logics and just remember it doing it your way, try to associate it to something that you can relate to and do it your way and just remember to the extent that you are able to and keep the remaining knowledge to be absorbed later on with gradual practice sessions. Remember, "ROME WAS NOT BUILT IN ONE DAY!"


FROM CONCEPT TO IMPLEMENTATION 

Every time, you read concepts of the programming language, you need to not only write down and document the code as mentioned above, but also, implement them in your code by typing the code in a cloud editor of your choice, let's say, replit.com and this way, you are able to see the output of your code immediately in the console window. By seeing the output while you are learning concepts, you are able to learn more efficiently and quickly without making any extra diligent efforts on your part to memorize the code! :-) 

Doesn't this make your learning journey more exciting and productive, rather than stress about having to remember the code ?


APPLY PARETO PRINCIPLE /THE 80-20 RULE

The most important thing you need to note is that you don't need to remember all the code syntaxes in one shot. In other words, you don't need to memorize or remember or retain 100% of the code in any language at first. The Pareto rule or the 80-20 rule signifies the importance of prioritizing 20% of the task to achieve 80% of efficient output.

According to the Pareto principle, in learning a programming language, you are supposed to prioritize the 20% of the coding language concepts and code syntaxes, that are really the essence of the language and really understand them well, in order to be able to reach a productivity level and efficiency of 80% in that language. You can prioritize the most important learning part of the language by practising all the steps that I mentioned in the above paragraphs. If you wait until you learn all the 100% of a Programming language to its full expertise levels, it is never going to happen, since, even the best of industry Programmers can not claim to be the very best to the extent of knowing it all and never getting stuck even once , the reason being, the software engineering industry is ever-evolving and what with constant updates in code and software frameworks etc., even expert engineers and programmers need to keep themselves updated, hence the learning curve is always never-ending, and you surely need to look up resources every time you come across complicated software projects!


CONCLUSION

Coding is hard to remember, but you could practice best strategies to remember code for any Programming language. Staying consistent with your daily coding habits, practising coding projects on a regular basis, while drawing inspirations from others' code will trigger your brain cells to retain code. You must remember to stay close to good coding habits such as understanding the logics behind every code syntax rather than making desperate attempts to commit to memory and also thinking logically rather than trying to rote the syntaxes. It is also not a good idea to copy and paste from others' code as this will lead to laziness and stop you from growing as a Programmer. 

As we all know, Rome was not build in a day, and it is very frustrating to try to compare yourself with Rome or any other programmers who have several years of work experience in the industry. It is always a good idea to test your code at every phase of your learning journey as this will enable you to learn how to debug and refer to other resources until you have solved your code. Applying the Pareto principles to your learning curve could make your code retention much more efficient and will improve your code memory faster.


Related topics to read:

How to learn Multiple Programming Languages






















Comments

Popular Posts

Build A Random Quote Machine in React

A Simple Guide to Promises in JavaScript ES6

Build A Calculator in React

Welcome to my first Blog Post

How To Fight Programmer's Imposter Syndrome

Top Free Online Websites to Learn Coding

Guide to Learn Coding Efficiently and Effectively