Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm currently using a great book to learn what I need to know about making app's for the iPhone using cocos2d.

So far, I am doing great, I read all the code and most of the time, It fits and I understand it. Sometimes, I go through it a couple of more times, over and over just so I fully understand something. My question is.. am I supposed to remember this code? Because while I do understand every block of code and why it exists, I can remember the code as well, but is that necessary ? What am I supposed to remember? The order? I already understand 99% of the syntax (so far everything is clear) .. I hope I'm making sense here.

Do I move on after I read the block of code and understand it? Or do I move to the next block of code only if I remember what was in the previous code block? Because I can understand it, write out the code, learn why it's there, etc and then I move on, but is remembering it all what I'm supposed to do?

share|improve this question

migrated from stackoverflow.com Jan 15 '12 at 7:14

This question came from our site for professional and enthusiast programmers.

2  
1) You will remember the code a lot better if you actually write it. Do the examples in the book, don't just read them. 2) I keep an organized collection of code snippets for future reference so I don't have to remember every little detail, which is impossible. –  DOK Jan 14 '12 at 19:16

4 Answers 4

up vote 6 down vote accepted

The key is to remember the concepts and approaches, why certain things are done in a certain way and how to read an API. It is not necessary to remember every line of code. It is not even strictly necessary to remember all the syntax if you are using an IDE although it is better if you can.

Part of the skill set of a good developer is to quickly be able to find out how to do something new by googling or searching / asking the right question on here. Understanding the concepts and patterns you are learning will give you a good basis for applying the answers you find.

I'm sure you will be successful, it sounds like you are going about learning the right way.

share|improve this answer
    
Thanks a lot for the reply. I'll keep this and all the other replies in mind when learning and developing. –  user996173 Jan 14 '12 at 21:08

No, you shouldn't take a "memorize the codes" approach to learning. A good book to check out is pragmatic thinking and learning, published by the pragmatic programmers. The book articulates that there are different levels of expertise.

A beginner cannot work without explicit recipe style instructions. This is characteristic of the beginner skill level. Beginners cannot solve problems for themselves usually, because they have not yet developed the ability to introspect and find their own errors. In the beginning it is important to ask good questions. As you advance, you'll develop the ability to troubleshoot your own code. Soon after, you won't need the "recipes" to figure out how to do something, and you'll be able to look to the API documentation (or the code). Finally, when you're truly a proficient programmer, and familiar with your platform, coding will feel like second nature.

You'll still need to stop and think about algorithms and design, but when tasked with implementation things will be smooth.

For now just read the book, and do projects. You need to do projects. You need to attempt things of your own that do not have explicit instructions and refer to the book when you get stuck. This is how you can take the next step.

Also, this thread should be migrated to programmers.SE and has nothing to do with the tags it is associated with.

share|improve this answer

You think you know until you actually try to do it. Don't just read the book, do the examples from the book—especially variations and combinations of problems you encounter.

Say it teaches you how to create a particle explosion. Create five of those, with different colors and speeds and masses. Have color change based on velocity and distance from the origin. Create your own formulas. Mess with the algorithm. Then later it teaches you have to make cars. Make ten of them. Crash them together. Go back to what you learned about the particle explosion, and explode the cars.

Combine your previous knowledge with your newfound knowledge in new and interesting ways. Until you can use the knowledge that you've gained from the book to create something new you can't really say that you've fully understood it. Don't just read. Do.

share|improve this answer

You are using the book to learn the tools needed to write an application on the iPhone.

The end result is that you can write an application, if at the end of reading the book you can write the application that you want you have remembered sufficient to do the work.

The minimum you need to remember is enough to understand the code and to know where to lookup information that you need to complete the task. It is a trade-off between spending time memorising things upfront or writing code for your applications more slowly as you have to search for information. However as you write more applications you will speed up the writing of code as you will have repeatedly use the same information and will remember it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.