Lurker News
It is common knowledge that when first learning programming, one should start with small projects to build something real rather than learning rules and syntax of the language only.

Which are some of the best books that take a project based approach in teaching programming to a beginner?

Comments (203) 92 threads

Show all comments

Showing thread 8 of 92

culopatin7 replies#
My biggest gripe with all the project tutorials I’ve seen is that really quickly you get into a “ok I get what we’re doing” and then just copy the code they provide. At the end of the day you did zero mental workout because you didn’t have to figure out the code. I hope to find one of these that guides you but doesn’t give you the code immediately, but has a code answer key at the end or something. I get it that it’s not easy to do, but there must be one out there that doesn’t spoon-feed you everything.
dielll#
Datacamp does what you want
ojl2 replies#
That’s why I like The Ray Tracer Challenge. He gives you test scenarios and a little bit of pseudo code (sometimes). The actual implementation has to be done by the reader.

http://raytracerchallenge.com/

the_gastropod#
+1 This is one of my favorite programming books. It's a very rewarding-feeling experience to build something so capable so quickly.
aeontech#
That's really cool, probably deserves its own submission for discussion!
thr0wnawaytod4y1 reply#
For this reason you need to find _your own_ projects, solve your own problems (which are actually pretty common, but you have to search or figure out a solution)

That's what I tell everyone

travisjungroth#
The issue I’ve found with that in my students is they then have to play the role of product manager in addition to software engineer. Those choices add a lot of mental overhead. There’s a balance between motivation and pressure for most students.

I think cloning is more the way to go. Pick some existing project/product and copy the essential components. Less choices, doesn’t have to end up getting used.

intelVISA1 reply#
Thinking of building something along those lines i.e. you can peek ahead if you really get stuck.

Proj-based learning is really fun to both create and consume imo.

culopatin1 reply#
If it helps you in any way, what I try to do is to use a tutorial book to build my own app. For example a Flask tutorial that shows how to build a blog app, but I’m building a library. I still learn about the Flask way and I learn some building blocks but I have to figure out the equivalent for what I want to do. I often get stuck though.

So maybe showing the building blocks and letting you use them for something. You could perhaps show 2 or 3 suggested projects that are built with the building blocks. You show the generic version of the blocks, and then you figure out how to tweak them to make one of the 2 or 3 suggested projects.
Sort of buying the legos and then showing what you could do with them. But building it is up to you.

intelVISA#
Good idea, originally I would just build something that already exists from scratch e.g. a UNIX-like OS complete with 99 footguns.

Now I've learned better I try to channel my learning energies into extending my portable, reusable library that solves common problems I can iterate, improve and port into future projects.

mgomez2 replies#
To force myself “to figure out the code,” I typically do the tutorial in a different language. I wanted to get familiar with Java last year, but all the books/tutorials were boring to me. What I ended up doing was going through a book that showed how to write a backend in Go (which was also unfamiliar to me at the time) while simultaneously porting it to Java (using Vert.x). Probably sounds inefficient tackling two languages at once, but it was the only way I was able to stay engaged with the material. Of course I ended up with something unidiomatic in terms of Java, but the project works and I now have motivation for a proper refactor to keep the momentum going.
usmannk1 reply#
I was looking for golang in this thread and this is the only reference I found. Would you mind linking the Go book you reference? Thanks
usmannk#
Thanks!
dgb23#
I have done the same thing! Read Crafting Interpreters but wrote the first half in Clojure instead of Java.

I think it's a good method for experienced programmers, who are self-taught (like me) or just want to brush up some skills and knowledge.
Yes, you stay engaged, but there is also something to be said about porting code between different languages. The differences, strengths, weaknesses etc. stand out more, similarities become more clear and things that seem different, but are analogous emerge.

cardanome2 replies#
One thing that helps me a lot when learning new languages is to NOT copy and paste but actually re-type the code.

You will be forced to read more carefully and, more importantly, you will make typing mistakes. Hunting down your own mistake will teach you the subtleties of the syntax as well as further increase your understanding of the code.
For more advanced programmers, there is also the challenge of translating the code into another language entirely, which requires a actual semantic understanding of the code.
Also once the project is done, adding small additional bonus features will further deepen your understanding.

culopatin2 replies#
I re type it but I don’t necessarily learn how to come up with that code when I’m off the leash. It’s useful when learning new syntax for sure though.
grugagag#
It’s a stepping stone. Doing that will make you a little bit less uncomforable when you get out of your depth, that until you hit another stepping stone and feel even more comforable.
gre#
You can try to retype it from memory too. Or write down a list of the crux functions (like a word bank) and then figure it out again.
zem#
i once sent an online book author a bug report that the font used in the code samples contained ligatures, so i couldn't just copy and paste them in. he replied that it was a feature :)
digianarchist#
Tips that have helped me:

1. Typing out the code.
2. Going off route. Change things. Personalize examples. Break things and fix them.
3. Look up the docs for the language/framework/library and see how you can extend the project after each chapter.