Live data from Hacker News

Ask HN: Learning to code, without a computer?

news.ycombinator.com

171–180 of 194 posts

Re: Ask HN: Learning to code, without a computer?

#171
You could give him a pack of cards, and a book on data structures and algorithms.

He can learn the algorithms and apply them to the cards in order to check his understanding. He just needs to make sure that he acts like a computer would - only ever comparing two cards at once.

He can simulate this by having all cards placed face down apart from the two that he's currently doing the comparisons with. At the end he can flip all the cards over to make sure he got the intended result.

I'm sure by doing this he could learn all sorts of algorithms this way, and learn to code in the same way.

He may not have a computer, but don't they say that the greatest computers are the ones in our heads?! He just needs to dumb it down a bit for the sake of the exercise.

Re: Ask HN: Learning to code, without a computer?

#172
Adding one aspect to this already comprehensive list of good advice: Read good code.

There is a lot to be learned from writing code as it forces you to make decisions. This can be done in part on paper and in batch programming mode. There is also a lot to be learned from reading not just snippets and algorithms but from studying complete works. Software is a lot about architecture and integration. A stack of printed code and a #2 pencil is all it takes.

Re: Ask HN: Learning to code, without a computer?

#173

Learning to code without a computer is what we all did, 40 years ago! He may write programs on paper, and send them to you to type them in, compile them, and print out a listing with the errors. You then send back the listing, and he will correct his program and repeat. He'll become a great programmer, since he will have to be extra careful to avoid losing one week on some typo. Now, it's been a few years since gcc h…

What is 'listing of the compiled source'?

This page gives a pretty good rundown on how to create a listing: http://www.systutorials.com/240/generate-a-mixed-source-and-....

Basically it's a listing that intermixes the original C code with the generated assembly.

It worked fine on my Ubuntu 16.04 system, running GCC 5.4.0 so I don't understand what was better before.

Re: Ask HN: Learning to code, without a computer?

#174
I can suggest a simple approach that worked for me. I learned to code without a computer by reading interesting coding books and writing my programs on graph paper. I did not worry about my approach because I did this for fun. I made each decision about my learning based on whether it was interesting and that it expanded and exercised my knowledge. Save written programs. Carefully play the role of the computer and execute your own programs and use graph paper for pixels. Copy and modify code from books. Know that you're building a foundation and going to the great lengths that only a great coder would attempt.

Re: Ask HN: Learning to code, without a computer?

#175
I can suggest a simple approach that worked for me. I learned to code without a computer by reading interesting coding books and writing my programs on graph paper. I did not worry about my approach because I did this for fun. I made each decision about my learning based on whether it was interesting and that it expanded and exercised my knowledge. Save written programs. Carefully play the role of the computer and execute your own programs and use graph paper for pixels. Copy and modify code from books. Know that you're building a foundation and going to the great lengths that only a great coder would attempt.

Re: Ask HN: Learning to code, without a computer?

#177

Learning to code without a computer is what we all did, 40 years ago! He may write programs on paper, and send them to you to type them in, compile them, and print out a listing with the errors. You then send back the listing, and he will correct his program and repeat. He'll become a great programmer, since he will have to be extra careful to avoid losing one week on some typo. Now, it's been a few years since gcc h…

While I agree that its what we did 40 years ago, it's not generally how we do it now.

I would concentrate on the things that don't require a computer- algorithms and mathematical type stuff (the stuff I am not particularly good at these days because I am usually setting up servers, using a database and high level frameworks).

Re: Ask HN: Learning to code, without a computer?

#178
I can't seem to find the reference to it, but there was a link on HN a couple of years ago of a dad who taught kids (9 year olds IIRC) to program a robot by creating a real world obstacle course, giving them a basic set of "commands" that they could put together on post-it notes and a parent or another kid being the "robot" that "ran these instructions".

I have used this to introduce my son to the basics - and call it "post-it" programming. We built a few obstacle courses around the house. The most advanced we got was to "unload the dish washer", that resulted in him "inventing" functions.

It typically works better when some one else "executes" the program, since bugs are easier to surface and debugging is a lot more fun.

That said, my son has since learnt to read and write. There is greater enthusiasm to "type" on a computer than use post-it notes.

Hopefully this can be adapted to your friend's circumstance. Best wishes to him.

Re: Ask HN: Learning to code, without a computer?

#180
I thought of several books, but they've all been mentioned in the thread already, so I'd just like to congratulate everyone on the wide range of interesting suggestions.

OK, I guess I'll also mention Hillis's The Pattern on the Stone, which I feel has mostly been superseded by Petzold's Code. It's less technical and less detailed than Code and would be a much quicker read, where Code gives a more detailed understanding of these ideas.

Post reply on HN