How to balance between reading doc/reference book and actual coding practice

Okay. Here is the question: How do I balance between reading reference book like Pro HTML5 and CSS3 design pattern and actual coding practice (like clone my favourite site).

I am currently reading a few books and taking notes about some specific rules in CSS. It is super helpful, don’t get me wrong. I realise that with all these so called “basic” knowledge, I will be able to troubleshoot my code more easily, not just stuck in the state of “Why is it working??? I don’t know why. Why is it not working??? I don’t know why.”. And I do feel that I learn something every single day by reading docs and taking notes. But I haven’t been coding for a while, at least 2 weeks.

How do I balance out these two practices??? Do you guys read books?? If so, when you decide you need to stop coding and start to reflect your work a bit??? How did the whole process go??? I am really interested to know. Please share here. It does not matter whether you are a new comer or a more experienced dev.

1 Like

You can implement a practice called active reading. Read making predictions under the Strategies sub-heading. When you read code think of some small test you can run to make sure the code is correct.

// lame example
function sum( a, b ) {
  return a + b;
}

You could try to pass sum three variables, sum( 1,2,3 ), and see if it works. Or something simpler pass in different parameters than the author of the book your reading.
You can debug the author’s code inside chrome browser. Press F12 to bring up the chrome developer tools. Add the line “debugger” to your code. Take a guess at what you think the code should do. Then run the function and verify the code behaves the same way as your prediction.

function sum( a, b ) {
  debugger;  // line needed to debug code in chrome browser
  return a + b;
}

Do the same thing with CSS. Slightly modify code and see if you get expected result. Try not to read more than 10 minutes without running test in browser or modifying css. Also, when people have problems with their code in forums or chat rooms. Copy the code and see if you can fix their problems. Even if you can’t fix their problems your mind will stay actively engaged in thinking about problems. You should start to see familiar patterns in code. Your debugging skills should go up. That is one benefit of everyone answering the same problems in fcc. You can recognize patterns and common errors.

1 Like

I feel like I don’t learn from books because of that, because I usually sit away from a computer and read and take notes. I really tried it that way but the way my brain is wired is that no matter how many times I read about something, it doesn’t really sink in until I actually code with it. So while I still read, I just favor video content more and code along.

2 Likes

Noted. thanks! I will do the same!!!

I always type out all the examples in anything I read, and if there’s something in my code I don’t understand I do some research online. This helps me out a lot; I wouldn’t want to read through material unless I could try coding what I’m learning at the same time.

Yeah. That’s what I did too. But sometimes it feels a lot more tedious.

Read and then implement. 30% reading 70% coding.
Famous rules that work. However, it depends on how highly technical is the book because in some cases it is harder to implement. What I do then is use our cute little friend Github and search for, say ‘JS projects’, then look through the code and try to find the parts that book was writing about. It’s not as good as implementing by myself, but sometimes it is just enough :wink:
For CSS hackery you should find some good examples on codepen. And html… well…

1 Like

What I do is I read books on my free time (in between classes, when commuting etc.) and do projects on my dedicated study time (before and after school). That way, I’m reading on a relaxed environment. Which helps me a lot because I tend to put a lot of pressure on myself to learn the material when I planned to study the said material. I might take a lot of time to finish a book, but at least I know I didn’t rush it and I fully absorbed the ideas and concepts.

So I guess it’s a 85%-15% split in favor of projects / coding practice.

1 Like

I only have one simple method. I ask the question. Do I really know this stuff? I then go and hit the code. If I find that I can’t code it. It means I don’t really know it well enough.

I tend to code everything from scratch despite knowing that there are reusable methods/function.

1 Like