Ask HN: Guiding Novice Programmers

6 points by mscarborough ↗ HN
Over the last year, I have been approached by intelligent colleagues with little-to-no programming experience. They want to understand code (at least to be able to read it within our application), and have tried to self-study but have not been able to feel confident or reach the level of understanding they would like.

I've read some papers on the subject, but does anyone have success stories for this situation, and how it worked for you? I am pretty removed from the time when I did not really grok how to program, so I don't think I've been the best help. I once recommended 'Learning Python', but that spoke more towards my appreciation of the language than being a good primer.

Thanks, Mike

4 comments

[ 3.0 ms ] story [ 20.9 ms ] thread
Get them to start on something small rather than to dive head first into a huge application. If you don't have overview, and that's a really big issue in the beginning you will never build up confidence. Baby steps are small steps. Then once they master that build out the scope.

Maybe isolate some small part of that application and make a little unit test around that so you can understand the whole.

That way it still has some relevance to what they want to achieve.

Make sure they're familiar with the documentation tools and web sites (e.g. for Python, they should know how to "pydoc" library calls, and how to find stuff on python.org, so when they see a library call or a new construct, they may be able to figure out what it's doing).
I think one key is to have a solid understand of the fundamentals - I think programming is like martial arts that way. As usual, it doesn't have to be exact, just a useful abstraction. What is a computer program, anyway? A set of instructions for manipulating data and devices attached to the computer. The CPU can only manipulate data in RAM, so you have to load data from storage, network and other devices. If you want it to live on past the program running, it needs to be sent out of ram. At the low level, all computer programs boil down to machine codes - sequences of simple operations. There's no need to learn them. Higher level languages stand between human language and instruction primitives. A compiler does the translation. Higher level languages all share certain fundamental concepts : functions, loops, variables and in some cases, classes and objects. An object is a bunch of data grouped together with a name and classes define common characteristics of objects. Once they understand these basics, they should explore them in some safe environment. There's plenty of ways to do that. I really think you need to get this kind of basic literacy down first and it doesn't matter what language it happens in. Once they get over this hurdle, focus on data and use cases. What is your application about? What are people trying to do with it, why did someone build this thing in the first place? What are the fundamental types of data involved and how are they transformed? I think all programs tend to be broken down into input, processing and output. Where can you see these things in your application? That gives the lowest level building blocks and the highest level overview. From there, it depends on their interests but however you slice it, a good place to start is to explain version control and give them a bug to fix. Once they get frustrated, do pair programming.
For this kind of thing, I recommend the book

"Code: The Hidden Language of Computer Hardware and Software" by Charles Petzold.

http://www.amazon.com/Code-Language-Computer-Hardware-Softwa...

Being a CS major, I bought this book for the sheer amazement at how the gist of everything I had learned about computers in the university could be conveyed in one book in such easy and fun manner. The learning curve is so gentle, it just couldn't be easier. I cannot recommend this book enough to _every_ person who really wants to understand how computers work.