Ask HN: Books that teach programming by building a series of small projects?
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?
203 comments
[ 9.6 ms ] story [ 665 ms ] threadThere are lots of starting from scratch guides, and few focused guides.
for subject in ["Finance", "Contact Management", "Service Desk Automation", "Web Apps from scratch", "Web Apps on someone else's API", "Baseball Metrics"]: for language in ["R", "Go", "Python3", "Rust", "Lisp"]: print(f"Examples for {subject} in {language} would make a good book.")
edit: no idea how to smash indent-formatting into MD-for-HN
[0] https://news.ycombinator.com/formatdoc
It teaches you step by step the basics of programming (loops, function calls etc) using a scratch-like programming language.
Available free online at https://third-bit.com/sdxjs/
https://cs50.harvard.edu/x/2023/
It has a collection of blogs for building various small projects to learn different languages.
* Projectbook https://projectbook.code.brettchalupa.com/
* Project Based Learning https://github.com/practical-tutorials/project-based-learnin...
and http://newcoder.io Both take the student through the process of building one fully-functional application.
Highlights https://automatetheboringstuff.com https://inventwithpython.com/bigbookpython
- Zed Shaw’s Learn More Python the Hard Way[1]
- Brian Hogan’s Exercises for Programmers (best for beginners or for learning a new language)[2]
- Hal Fulton’s The Ruby Way[3]
- Chris Ferdinandi’s Vanilla JS Academy[4]
- Marc-Andre Cournoyer’s Great Code Club (it’s old, and the community doesn’t exist anymore, but i think he still maintains it)[5]
- A few python books from No Starch Press (notably those authored by Al Sweigart)
I learned the most as a beginner from Zed Shaw’s work, and from reading open source code.
Once you’re done with the initial “learn from tutorials” phase, there’s no better resource than reading open source code.
[1] https://www.amazon.com/Learn-More-Python-Hard-Way/dp/0134123...
[2] https://www.amazon.com/Exercises-Programmers-Challenges-Deve...
[3] https://www.amazon.com/Ruby-Way-Programming-Addison-Wesley-P...
[4] https://vanillajsacademy.com/
[5] https://www.greatcodeclub.com/
I had a little bit of Python(2) under my belt from general curiosity, and I've done some C++ in high school so I have some "CS Theory"
There is a "more" python version out now https://learncodethehardway.org/more-python-book/
Amazon ( the "newer" version proposed is not, it's his python2 book ) https://www.amazon.com/Learn-More-Python-Hard-Way/dp/0134123...
I know his "criticism" also held back many from moving their libraries to Python 3 by sowing doubt in the community, and ultimately may have slowed down adoption overall.
Do you just search for projects in the language your using on github?
I would then try to re-implement the “getting started” code in the readme from scratch, like a little programming puzzle. If I can’t figure it out, I‘ll add in some debugger breakpoints, inspect the stack trace to understand how it works, then code the needed methods / classes as I go.
If you’re a ruby programmer, soveran’s work in github can be read in a day or two. I specifically like cuba (micro webframework) and mote (microtemplate).
[1] https://automatetheboringstuff.com/
Yes for example https://nostarch.com/inventwithpython and https://nostarch.com/big-book-small-python-projects
https://news.ycombinator.com/item?id=22299180 Ask HN: What are some books where the reader learns by building projects?
In a similar vein, there is The Architecture of Open Source Applications which is great:
https://aosabook.org/en/index.html
Yes, but don't overlook the great learning that is gained, at the beginning of any learning, by studying from many different sources (aka good books). It seems that something magical happens when you do this: the confrontation of ideas from different sources can make you better absorb ideas and resolve any doubts that you didn't understand before.
https://norvig.github.io/paip-lisp/#/
But, of all the books I worked through, this is the one I remember just having tons of fun because the examples are so cool and the code so… clear. I think norvigs programming course in python (which I only skimmed) could be a great modern equivalent.
https://www.hackingwithswift.com/100
Was a really fun read.
There are some follow ups to the final project I like
Compile to WASM so you can run on the web: <https://hands-on-rust.com/2021/11/06/run-your-rust-games-in-...>
Port to the Bevy ECS: <https://saveriomiroddi.github.io/learn_bevy_ecs_by_ripping_o...>
But also pretty much every book does that.
Not to mention they're all freely available and give excellent value for both time and money: https://inventwithpython.com/
I was looking for a book that had offline projects I can work on while on flights, and this book focuses on rebuilding linux utilities using rust. The other nice part is that you get a better understanding of linux internals.
I believe the author is also responsive on the rust subreddit.