Learning to code and how to approach a new programming language
I am learning C++. This is a new language for me than the ones I already know (or at least I think I know them). I am writing this post to share with you what learning process I am applying.
Here are the rules I am trying to apply:
Once you have finished and the most important information is in your long term memory, you have to practice. It is nice to dive deep into the advanced topics.
That's all I guess.
You don't agree? Please, feel free to leave a comment bellow and we can discuss it. Also, don't hesitate to share what is your approach. I can learn something from your experience as well. I believe those rules above are not written in stone but more of advice to follow.
Here are the rules I am trying to apply:
Code every example from the book.
When you read the example your mind tricks you to say "Oh, it is pretty logical and easy. It makes sense" until you code it and run it. Only then you find out if you got it right at first. When you start seeing errors from compiler or interpreter, then you start getting familiar with them. Later, when you stumble upon the same errors again, you know what to do to fix the error so you can move on. Take as an example reading how to drive a car. Reading about it or watching how others do it is not the same as when you actually do it. It is the same with coding. You have to try, to fail and raise. Only then the brain learns.Do not use an IDE.
The IDE will autocomplete most of the objects and methods for you. It will guide you what is right and wrong way before trying to execute it. Do not do it. It is fine to use an IDE when you are experienced and you need to be robust, but in the moments when you learn, it is better to write everything by yourself. So pick a text editor that suits you and you feel comfortable with and start typing. Remember, it should be an editor you are experienced with. Do not combine two new things at the same time. I did this mistake when I trying learning Lua a few year ago. I decided to combine it with learning Vim. A huge mistake. I didn't learn any one of them.Do not copy and paste.
Try to type every code from the example yourself. But don't just blindly type it while looking at it. Try to read the example, try to understand what every line of code is doing. Try to find the logic behind it. Then try to type it without looking into the example. At least give it a try. If you feel stuck, peek into the example for a moment and continue typing by thinking about every line.Ask yourself "What if".
Open the text editor and tweak code with everything that bothers your mind like "Should I use this keyword or not". Try to break it. When you write a program that expects user input, try to provide wrong input and see how the program will act.Take notes.
Having a notepad (a physical one) next to you will make your mind remember more things if you write them down. Even if you think you won't open your notes to read them, write down what you read about. Anything that is an emphasize of that you read.Use your notes as a cheat sheet.
Do not search in google if you are sure you have passed through what you currently struggle with. Use your notes. The idea is to make your brain store the new information in your permanent memory than the temporary one. So use your notepad as a cheat sheet when trying to find an answer. Sometimes you can just open your notes and read them, or scan them. I found myself wondering when I have written this down.Do not give up.
When you go hiking a big mountain you don't say "Oh, this is too far it will take me hours to reach the top" but you just star walking, enjoying the view and the journey. Do not look at coding and learning to code as a destination. Look at it as a journey and don't give up.Do not rush it.
Or do not jump way ahead. Start with simple things. Take for example learning how to play a guitar. You have to pass through the accords leassons before you start playing songs. It takes time, it is boring but you have to do it. And take notes!Read again.
This is not a fiction story tale. You want to remember this and benefit from reading it. You want to put this information in your long term memory of the brain. So don't be lazy and read it again if there is something you don't understand. Sometimes I read more than 5 times the same sentence over and over again until I understand what is the meaning behind it.Search for different sources of information
It wouldn't hurt anyone if you try to find different information about the same subject you are reading about. I believe the book you have started already is good enough but keep in mind that this is the author's view. There might be different ways of approaching the same problem that the author doesn't mention because they might be out of the scope of the book. Which is normal.Advanced techniques
Once you have finished and the most important information is in your long term memory, you have to practice. It is nice to dive deep into the advanced topics.
Search for online quiz.
Sometime I search for online quiz to take and examine my knowledge so far. Sometime I am searching for "JavaScript interview questions". Usually an interview contains a lot of tricky questions. This is about bits and pieces of the language you learn. How it actually works. So read it. Try to understand what you don't know.Read a legacy code.
Reading a book and sticking to it only makes you get used to the style of the author. In the real world every developer has her own style of writing and approaching problems. So find some project that is not too complex to understand and start reading it. You can look for open-source projects suitable for junior contributions.Start coding from imagination.
Challenge yourself with something simple that is not "Develop a facebook killer" for example. Do a logic for a simple game. Tic-tac-toe is a good example.How to structure a project.
This is a good subject to look for on internet. You will find out advice how to structure a more complex project.Best practices with the language.
We are aiming here not just to learn a language but to be really good with it. So read about what is considered a code smell in the language you are learning and what to avoid.That's all I guess.
You don't agree? Please, feel free to leave a comment bellow and we can discuss it. Also, don't hesitate to share what is your approach. I can learn something from your experience as well. I believe those rules above are not written in stone but more of advice to follow.
Comments
Post a Comment