So who else writes code outright when learning from books?

Just curious. I do it as a means of beating the ideas into my head. Granted it takes much longer sometimes than just plopping the code in from a file but its more fun to mess things up on your own and learn how to fix them.
I could be wrong but what do you all think?

1 Like

I totally agree with you. You can understand concepts just by reading them from a book, but you will struggle to internalize them and be able to put them to use later, unless you actually go through the actions of practicing as you learn - even to go as far as typing out the examples and testing them.

That is why I prefer project-based books and video tutorials, to theory-based ones. The theory-based books are best for when you already have a good grasp on the topic, and need a reference manual.

3 Likes

codecademy practices this very thing as tutorials require you to be able to complete the code yourself, and in some cases understand what you are writing. There are many topics in the Q/A forums where a user simply doesn’t understand the particular problem and it is considered a practice for the people who help not to simply give them the answer.

I myself wrote a single notes.js file where I kept track of very basic javascript information just to get it out of my head. I start from data types, move into variables, then arrays then objects then functions and loops. I progressively develop to more complex things so my foundation is established.

When you jump around from resources and projects, it can be very difficult without establishing “what you know”. So this is indeed a great idea. Actually I tweeted just the other day this article that talks about function composition in functional programming in accordance with other tweets by developers suggesting that it can be a better idea to write your code to get it functioning first, and then revisiting it to refactor it.

So by all means do so, and learn to refactor, and comment, and troubleshoot, and problem solve, and DRY. Go crazy, it’s what we all do.

1 Like

I do this at the moment. You get familiar with writing the code accurately, and you’d be amazed how much practice I get at debugging things. The only thing I’m not getting right now, is much practice of tackling a problem and solving it from scratch. Not many tutorials are so hot at structuring your thinking around a problem, to then conceive a way of solving them. If you can conceptualise around a likely solution, the code part can be a lot simpler.

1 Like

I’m loving the attention this got.
Thanks for the replies all.
Honestly I have been working at webdev since I was in highschool.
I actually built a website from scratch for both of my ‘senior projects’
It was a very basic XHTML / CSS thing back when I thought bluefish was the editor to use.
I have since built my personal site I hand coded this one as I was working my way though an online course. I intend for it to be a kind of knowledge archive for myself when its over. I also built my gaming community site with wordpress. It was way simpler than hand coding all of the functions I wanted but maybe one day I will get that good. I hope eventually to get to the point that I can build a multitude of things from basic sites / web apps all the way up to working on CMS’s plugins, addons and themes.

2 Likes

For the first 5 years as a software developer, I did all sample codes in the book but not anymore. Now, I just read them and code in my mind. As long as I get the concept then I move on. I do realize that you do learn more by doing it since you’ll resolve any issues/bug in the sample. Most of the time, the sample code in the book either doesn’t work or have some weird compilation issue. If it’s completely unfamiliar technology then I actually do all the samples. For example, I did that to learn Dockers.

1 Like

Can’t believe I didn’t link to the article: https://www.sitepoint.com/function-composition-building-blocks-for-maintainable-code/

Yes, it’s very important for reinforcement. Sometimes I try to write out all the code from memory, as that’s the real test. :slight_smile:

2 Likes

Very true. It’s amazing how many times I’ve followed through a tutorial, think I understand the idea, got to some exercise based on it, then thought “Errm… what do I do again?”

3 Likes

Of course, that’s the only way to learn.

I personally go a step further. I never follow the material exactly. If I understood the code, then I should be able to add or remove some of it and predict the result.

I remember years back working through a PHP booklet (for uni), it went through basic math, then it moved to a form where you type your name and it would return “your name is relio”. I thought that was boring and stupid, why would anyone want the computer to tell them what they already know.

So I started creating a calculator. I messed up, got pissed off, searched the web (stayed away from calculator tutorials) and slowly got the calculator working. The happiness I felt can not be described

Then after that I went back to the booklet. The next page it showed how to write a flippin’ calculator.

I never forget that, and whilst it takes longer then even just typing the code from the book, I think you learn a lot more. I now do that all the time. I read the code and manipulate it to get what I want. It’s not possible every time, but when its, I learn more by, let’s just say, getting a result I want rather than the result the author wants.

4 Likes

Maybe this topic should have the following title?

Is copy and paste detrimental to learning :slight_smile:

I got some very very very basic knowledge from books back in high school, but it didn’t really help me much when I needed to put it into practice. I guess… books help for the first few weeks, then it’s ‘learning on the job’ i guess

Sorry I keep going away so much,
This being said. I’m glad the topic got as much attention as it did.
So the ultimate point being learning is of course an individual thing as well as an exploration thing.
There have been a few times over the course of me learning that I would veer off in my own direction. If for no other reason that “I got this.” and it might take me a few google searches but ultimately I end up doing what it is I set out to do.

Reminds me of my maths lecturer when asked which course book examples to try. He recommended all of them. Apparently he managed to pass his final exam with 140%. The question paper was to answer any five from seven questions. After completing the first five he had time on his hands so answered the other two!

1 Like

I think that is a very very good idea, having a knowledge archive that you have curated yourself.

I don’t know what you mean exactly but I am assuming you mean a blog where you write “tutorials” for yourself.

They say that teaching others is the best way to learn. Writing tutorials/notes in your own words for yourself I think will help you a lot.

I have been told by a professor to keep a “log book” but I never listened. Few years a go I started my “log book” as a wordpress blog. and writing my ideas there I think helps me understand things clearer. Since then I moved to Jekyll, and this is just fantastic. I just open sublime text and start typing notes.

So I encourage you to go all out on the “knowledge archive” since you are going to be the soul user, forget about conventional design patterns design it in a way that you can navigate it in your sleep (push it to github every now and then, as you will mess it up sooner or later)

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.