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.<p>Which are some of the best books that take a project based approach in teaching programming to a beginner?
While not for beginners, if you'd like to learn rust I recently finished "Command line Rust" [1].<p>It was my first introduction to rust and the book was quite enjoyable. It starts off with teaching you the very basics of a command line (what it means to exit, true, or false, etc) and each chapter has you recreate a popular command line tool (like grep, cal, tail, wc) while introducing a new rust concept.<p>The book also does TDD, test driven design, by first teaching you how to create these tests then in subsequent chapters having the tests prewritten for you.<p>It's definitely worth a look, the author has a great writing style as well that isn't as monotonous as most programming books I've read.<p>[1] <a href="https://www.oreilly.com/library/view/command-line-rust/9781098109424/" rel="nofollow">https://www.oreilly.com/library/view/command-line-rust/97810...</a>
There’s quite a few:<p>- Zed Shaw’s Learn More Python the Hard Way[1]<p>- Brian Hogan’s Exercises for Programmers (best for beginners or for learning a new language)[2]<p>- Hal Fulton’s The Ruby Way[3]<p>- Chris Ferdinandi’s Vanilla JS Academy[4]<p>- 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]<p>- A few python books from No Starch Press (notably those authored by Al Sweigart)<p>I learned the most as a beginner from Zed Shaw’s work, and from reading open source code.<p>Once you’re done with the initial “learn from tutorials” phase, there’s no better resource than reading open source code.<p>[1] <a href="https://www.amazon.com/Learn-More-Python-Hard-Way/dp/0134123484/ref=mp_s_a_1_1?crid=QA7619O1989I&keywords=zed+shaw+learn+more+python&qid=1673963222&sprefix=zed+shaw+learn+more+puthon%2Caps%2C343&sr=8-1" rel="nofollow">https://www.amazon.com/Learn-More-Python-Hard-Way/dp/0134123...</a><p>[2] <a href="https://www.amazon.com/Exercises-Programmers-Challenges-Develop-Coding/dp/1680501224" rel="nofollow">https://www.amazon.com/Exercises-Programmers-Challenges-Deve...</a><p>[3] <a href="https://www.amazon.com/Ruby-Way-Programming-Addison-Wesley-Professional/dp/0321714636" rel="nofollow">https://www.amazon.com/Ruby-Way-Programming-Addison-Wesley-P...</a><p>[4] <a href="https://vanillajsacademy.com/" rel="nofollow">https://vanillajsacademy.com/</a><p>[5] <a href="https://www.greatcodeclub.com/" rel="nofollow">https://www.greatcodeclub.com/</a>
My favourite is "Practical Common Lisp" by Peter Seibel (<a href="https://gigamonkeys.com/book/" rel="nofollow">https://gigamonkeys.com/book/</a>)<p>Not only is the book free to read (although I would suggest to pay for it if you like it!) The code to parse binary files actually "inspired" my design of an actual production application which was very flexible, succinct and, most importantly, so fast I had to spend a lot of effort convincing people the numbers are actually true.<p>It taught me some important lessons about how you can achieve performance with Lisp languages and the real reasons for the power of macros. Not too shabby for the first book on Lisp I red!
Not a book, but check [Build your own X](<a href="https://github.com/codecrafters-io/build-your-own-x">https://github.com/codecrafters-io/build-your-own-x</a>), a compilation of well-written, step-by-step guides for re-creating our favorite technologies from scratch.
"Hands on Rust" teaches Rust by building a rogue like game step by step. Before that there's a chapter where you rebuild Flappy Bird from scratch that teaches the "basics" before diving into more advanced concepts in the rogue like. I liked the approach and recommend the book but it's fast paced and expects quite a bit from the reader (it's excellent if you have some programming experience already but probably daunting as a true first book imo).
Not a book but The Coding Train on Youtube is probably one of the best introduction to programming. It's fun to watch, Daniel Shiffman is a fantastic teacher and he doesn't take himself too seriously.<p>But what sets this course apart from any other are the coding challenges. Following the thought process of a programmer in real time, watching him making mistakes and hunting for bugs is invaluable.<p>He uses p5js, a javascript library for graphics. The lessons are geared towards generative art but cover a broad range of topics including machine learning.<p><a href="https://www.youtube.com/@TheCodingTrain">https://www.youtube.com/@TheCodingTrain</a>
For Swift:<p><a href="https://www.apple.com/swift/playgrounds/" rel="nofollow">https://www.apple.com/swift/playgrounds/</a> (I've had more success introducing programming with this than with any of the links below; it's a very compelling intro for those who already own an iPad/Mac, and the core concepts are generalisable to other languages/environments even if it's specific to Apple's APIs and hardware.)<p>~~~<p>For Python:<p><a href="https://automatetheboringstuff.com" rel="nofollow">https://automatetheboringstuff.com</a><p><a href="https://nostarch.com/big-book-small-python-projects" rel="nofollow">https://nostarch.com/big-book-small-python-projects</a><p>~~~<p>For JS:<p><a href="https://eloquentjavascript.net" rel="nofollow">https://eloquentjavascript.net</a> (project-based and for beginners)<p><a href="https://javascript30.com" rel="nofollow">https://javascript30.com</a> (not for total beginners or self-study, would need a friend/tutor)
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.
There is this excellent Github repo for this: <a href="https://github.com/codecrafters-io/build-your-own-x">https://github.com/codecrafters-io/build-your-own-x</a><p>It has a collection of blogs for building various small projects to learn different languages.
Software Foundations is a series of interactive books where you work through proofs in Coq, gradually increasing in complexity: <a href="https://softwarefoundations.cis.upenn.edu/" rel="nofollow">https://softwarefoundations.cis.upenn.edu/</a><p>This is a bit on the edge of the domain that you're asking about (not really for beginners, and proofs are perhaps a somewhat niche type of programming) but I learned a lot from this and many people don't seem to know it, so I think it belongs in the list.
HTDPv2 <a href="https://htdp.org/" rel="nofollow">https://htdp.org/</a> - it's about learning to program rather than teaching a specific language.<p>I thought the little projects you build along the way struck a good balance of interest, e.g. you're building a snake game by section 2 (but crucially you've already been exposed to how to think about data so you're not just dropped into the deep end with some boilerplate to fiddle with).<p>Anyway, i could write tons of praise for this book but it's convinced me to ditch python for teaching newbies and i LOVED python for getting newbies started real quick with projects for years.
Shameless plug if allowed: “The Road to React” goes through one large project to teach React.js from beginner to intermediate. I learned that going through one project it allows the teacher to go through a series of foundational aspects of the topic before implementing more advanced domain specific features which make use of the earlier learned building blocks for the real world project. Does it make sense?<p><a href="https://www.amazon.com/Road-learn-React-pragmatic-React-js/dp/172004399X/" rel="nofollow">https://www.amazon.com/Road-learn-React-pragmatic-React-js/d...</a>
This book is still in progress but I've gone through some of the chapters and have enjoyed it. Rust from the Ground Up: <a href="https://leanpub.com/rust-from-the-ground-up" rel="nofollow">https://leanpub.com/rust-from-the-ground-up</a><p>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.<p>I believe the author is also responsive on the rust subreddit.
For beginners, Daniel Holden's Build Your Own Lisp[1] is excellent material for learning C. It's a very succinct book.<p>For intermediate programmers, Build Your Own Redis[2] is a WIP book I am currently writing.<p>[1] <a href="https://buildyourownlisp.com/" rel="nofollow">https://buildyourownlisp.com/</a><p>[2] <a href="https://build-your-own.org/" rel="nofollow">https://build-your-own.org/</a>
Not a book and webdev focused, but I've been doing <a href="https://fullstackopen.com/en/" rel="nofollow">https://fullstackopen.com/en/</a> and it's been great.<p>The chapters are structured so you are building 2 projects at once. One where you follow along with the chapter material with example code and explanations. And a second in the exercises.<p>I really like it because it introduces the concepts in the context of a project, but you can't get stuck because the code is there too. Then you need to really apply it in the exercises on your own project, without the example code.
I mentioned The Ray Tracer Challenge in a comment below, and it seems quite popular so I’ll submit it here as well.<p><a href="http://raytracerchallenge.com/" rel="nofollow">http://raytracerchallenge.com/</a><p>It’s not really for beginners though, but maybe possible to start it together with a beginners book in a language of choice. It starts with points, vectors and matrixes, but gets more advanced later on. It’s around 250 pages and there’s basically no code provided, just test scenarios and a bit of pseudo code.
MUD Game Programming. Not sure how easy obtaining a copy would be in 2023 but it has two projects which I recall being a lot of fun. I never did build a successful MUD but did learn a fair amount about network programming.<p><a href="https://www.goodreads.com/en/book/show/927128.Mud_Game_Programming_With_CDROM_" rel="nofollow">https://www.goodreads.com/en/book/show/927128.Mud_Game_Progr...</a>
No joke, "C for Dummies" - it's more teaching you CS101 concepts, less about "C". Tons of examples to go through and the attitude of the author is very helpful compared to a lot of other styles out there.<p>I was failing my computer science classes first semester. Towards the end of the semester I sat down in the library for a few days and just went page by page typing every example and compiling it. Aced every IT class I had the next few years. I attribute that book to making everything "click" for me.<p>Once you understand the beginner concepts that book shows, then you as an individual would know where to look to gain improvement.
<i>Common Lisp: A Gentle Introduction to Symbolic Computation</i>(<a href="https://www.cs.cmu.edu/~dst/LispBook/" rel="nofollow">https://www.cs.cmu.edu/~dst/LispBook/</a>) has you build a number of small applications, like a substitution decipher application, a plotting function, and more, which it calls "keyboard exercises".
Peter norvig’s paradigms of artificial intelligence programming, despite its age, is a delight.<p><a href="https://norvig.github.io/paip-lisp/#/" rel="nofollow">https://norvig.github.io/paip-lisp/#/</a>
I don't know why jtimiclat's comment recommending Al Sweigart's books got downvoted and faded out, they are indeed quite good for beginners wanting to get their hands dirty with programming instead of cramming it in an academic way.<p>Not to mention they're all freely available and give excellent value for both time and money: <a href="https://inventwithpython.com/" rel="nofollow">https://inventwithpython.com/</a>
Sort of like that, I've been slowly working on a rosetta code for implementations of small problems. Rosettacode.org allows you to use standard library functions so many (but not all) of their examples are useless when you actually want to see how to code something from hand in the language.<p>So my rosetta code only allows you to implement the main part of the thing yourself. But it's not appropriate for beginners. It's more appropriate for teaching a new language to someone who is already an intermediate programmer.<p><a href="https://tinyprograms.org/" rel="nofollow">https://tinyprograms.org/</a>
For intermediate programmer, that's what we do in the Classic Computer Science Problems series (<a href="https://classicproblems.com" rel="nofollow">https://classicproblems.com</a>). We combine learning programming with learning computer science problem solving techniques.
My Cloud Resume Challenge project [0] and book [1] uses a set of small, stackable mini-projects to introduce beginners to many of the pragmatic skills used in cloud software engineering.<p>[0] <a href="https://cloudresumechallenge.dev/docs/the-challenge/" rel="nofollow">https://cloudresumechallenge.dev/docs/the-challenge/</a>
[1] <a href="https://cloudresumechallenge.dev/book/" rel="nofollow">https://cloudresumechallenge.dev/book/</a>
Per Brinch Handsen, Programming a Personal Computer. Book is online. Interpreter, editor and OS in about 10 KLOC. <a href="http://pascal.hansotten.com/per-brinch-hansen/" rel="nofollow">http://pascal.hansotten.com/per-brinch-hansen/</a> Also <a href="https://news.ycombinator.com/item?id=24913959" rel="nofollow">https://news.ycombinator.com/item?id=24913959</a>
If we're talking a complete beginner with maybe only "hello world" level skills I recommend the Lego BOOST set: <a href="https://www.lego.com/en-fi/product/boost-creative-toolbox-17101" rel="nofollow">https://www.lego.com/en-fi/product/boost-creative-toolbox-17...</a><p>It teaches you step by step the basics of programming (loops, function calls etc) using a scratch-like programming language.
Shameless plug:<p>FREE <a href="https://leanpub.com/rubyisforfun" rel="nofollow">https://leanpub.com/rubyisforfun</a> - Ruby Is For Fun, I made the book so you do a lot of exercise. There is around 80 exercises in total.<p>Rewritten as a course:<p><a href="https://www.educative.io/courses/handbook-ruby-developers" rel="nofollow">https://www.educative.io/courses/handbook-ruby-developers</a>
The famous <i>Structure and Interpretation of Computer Programs</i> (SICP) does this, in the Scheme language.
The whole book is online here, with the table of contents right at the front:<p><a href="https://web.mit.edu/6.001/6.037/sicp.pdf" rel="nofollow">https://web.mit.edu/6.001/6.037/sicp.pdf</a>
I found Al Sweigart's books nice for beginners.<p>Highlights
<a href="https://automatetheboringstuff.com" rel="nofollow">https://automatetheboringstuff.com</a>
<a href="https://inventwithpython.com/bigbookpython" rel="nofollow">https://inventwithpython.com/bigbookpython</a>
Python Programming for the Absolute Beginner (<a href="https://smile.amazon.com/Python-Programming-Absolute-Beginner-3rd-dp-1435455002/dp/1435455002/" rel="nofollow">https://smile.amazon.com/Python-Programming-Absolute-Beginne...</a>) has you make a game at the end of every chapter with the concepts you've learned so far. I've bought this book for a number of people, though perhaps Automate the Boring Stuff with Python: Practical Programming for Total Beginners (<a href="https://smile.amazon.com/gp/product/1593275994/" rel="nofollow">https://smile.amazon.com/gp/product/1593275994/</a>) is better if you don't want to make games.
The 'Arduino Projects Book' does a brilliant job if taking someone who knowing nothing about coding or electronics and setting out lessons and projects that take you from zero to somewhere fun.<p>I still can't really code, but I can have a lot of fun tinkering because of that book.
The New Turing Omnibus is a nice collection of small domain problems that can be solved with computation.<p><a href="https://oke.cx/mseih" rel="nofollow">https://oke.cx/mseih</a><p>In the domain of theoretical physics, I highly recommend, "From Newton to Mandlebrot".
> 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.<p>I would start by examining that assumption: it varies from one person to the next. If you like the project approach then great, go for it, but for other people it can be better to exercise individual features of the language in isolation until they are well understood, rather than trying to put a lot of half-understood features together into a more complex program. I have gotten into trouble over this myself a few times, and now definitely prefer the piecewise approach to the project approach.
I would suggest Practical Common Lisp<p><a href="https://gigamonkeys.com/book/" rel="nofollow">https://gigamonkeys.com/book/</a><p>You will create a MP3 database, a web server, a spam filter, a HTML generator. Really practical!
check this<p><a href="https://news.ycombinator.com/item?id=22299180" rel="nofollow">https://news.ycombinator.com/item?id=22299180</a>
<i>Ask HN: What are some books where the reader learns by building projects?</i>
I like “The Elements of Computing Systems: Building a Modern Computer from First Principles”.<p>You build a whole computer from scratch through small projects.<p>Sure, you want learn a specific language, but you’ll grock programming in general.
<a href="https://beautifulracket.com/" rel="nofollow">https://beautifulracket.com/</a> by Matthew Butterick - “An Introduction to Language-Oriented Programming Using Racket”
I recommend the Deitel[0] series for Python and C family languages like Java, C# etc.
With hundreds of complete examples to follow (not code snippets) and exercises to challenge you, you will do better with these books as a beginner.<p>My strategy is to get to the 10th chapter of the book skipping the exercises, then go back and try them with a better overall understanding of the language and its nuances.<p>Great series.<p>[0] <a href="https://deitel.com/" rel="nofollow">https://deitel.com/</a>
This one is nothing short of brilliant:<p><a href="https://www.manning.com/books/haskell-in-depth" rel="nofollow">https://www.manning.com/books/haskell-in-depth</a>
"Software Tools" by Kernighan & Plauger, perhaps.<p>The original was in Ratfor, which is a Fortran dialect. That being similar syntax but more limited than C is not a bad intro language.
Not a book, but CS50x is a freely available course with high quality videos and lecture notes. The lecture exercises are programming projects of sorts. It teaches programming from scratch with C and then Python. Plus, since a lot of students take it, there are lots of online resources with tips, like the CS50 subreddit.<p><a href="https://cs50.harvard.edu/x/2023/" rel="nofollow">https://cs50.harvard.edu/x/2023/</a>
Learning Rust, I use these 2:
1. Command-Line Rust: A Project-Based Primer for Writing Rust CLIs
2. Zero To Production In Rust (it's actually one project)
I can recommend "Programming: Principles and Practice Using C++", although the fact that it uses C++ as a first language can be a downside to some.
- Pick a language<p>- Find a recent book (< 2 yrs old) on LibGen.is<p>- OR, a Udemy.com video series (note: never pay more than $12 or so-- the promo rate. If you see a higher price, just create a new email & user account (or reset cookies?) and you'll see the promo price again)<p>- Visit: Roadmap.sh to get a sense of a learning roadmap what knowledge to build.<p>- Use a search engine to answer questions, such as "free learning resource for learning <XYZ thing>"
It's not quite the same as what you are looking for, but I've known multiple people who were stuck in their attemp to learn to code before using railstutorial, I view it and the book "sql: visual quickstart guide" as two very well designed intros that manage to avoid having sections with random jumps in difficulty and terminology usage that can leave true beginners behind.
Parenthesis: keep in mind that while learning by doing might be a good way to begin, even if I wouldn't be so sure as wether one "should" or "could" start along such a path, at some point you'll be stuck without studying the "boring" stuff you've delayed. True programming is realising the boring stuff weren't so boring in the first place
This is the best programming book I have ever picked <a href="https://www.amazon.com/-/es/Noam-Nisan/dp/0262539802/ref=sr_1_1?keywords=nand2tetris&qid=1673977221&sprefix=nand2%2Caps%2C322&sr=8-1" rel="nofollow">https://www.amazon.com/-/es/Noam-Nisan/dp/0262539802/ref=sr_...</a>
I'm very much a fan of a project-based approach. However, I wouldn't recommend any book for that. I'd ask the apprentice what they'd like to achieve, and try to reduce scope as much as possible.<p>There's a world of difference in motivation when building something <i>you want to exist</i>, versus building a project because a book told you so.
Check out my blog series, "Challenging projects every programmer should try". Who knows, maybe I will turn it into a book that shows how to implement each project :)<p><a href="https://austinhenley.com/blog/challengingprojects.html" rel="nofollow">https://austinhenley.com/blog/challengingprojects.html</a>
Hi! I would like to shamelessly plug my own book "Practical Python Projects". It follows project based approach. It is completely free to read online and has a paid EBook option if that is what you prefer.<p><a href="https://practicalpython.yasoob.me/" rel="nofollow">https://practicalpython.yasoob.me/</a>
How to Design Programs: <a href="https://htdp.org/2022-8-7/Book/index.html" rel="nofollow">https://htdp.org/2022-8-7/Book/index.html</a><p>It's lots of small problems that seem like projects and I've found it fun to expand on the examples on your own beyond what the book asks.
I failed to learn for the past 10 years and I am complicit. But partially as a self-taught, you have no clue which resources are good and which are not.<p>Recently all mainstream "learn to code" sources realised just making you memorise concepts doesn't work and started changing curriculum, but before that happens...<p>The best 2 resources I found are:
- <a href="https://learnprogramming.online/" rel="nofollow">https://learnprogramming.online/</a>
- <a href="https://scrimba.com">https://scrimba.com</a><p>Both are project driven and won't hand-hold you if you want to continue, you need to proceed based on a mastery learning method.
Programming Games for Atari 2600 <a href="https://forums.atariage.com/topic/339819-upcoming-book-on-atari-2600-programming-now-available/#comment-5153794" rel="nofollow">https://forums.atariage.com/topic/339819-upcoming-book-on-at...</a>
When I was young, I went about it the opposite way. I thought of some small project and researched how to implement it, then moved on to something bigger. Everybody is different of course, but I felt like I learned more having to figure out how to go about implementing each myself.
It's common approach because building something that <i>you want</i> is good motivation.<p>I don't think that works as well when it is some random project from the book. Like, sure, better than dry code, but I'm far more motivated to learn when I also make something for me.
Not quite a beginner book, but you should check out <a href="https://www.amazon.com/Mazes-Programmers-Twisty-Little-Passages/dp/1680500554" rel="nofollow">https://www.amazon.com/Mazes-Programmers-Twisty-Little-Passa...</a>.
The Symfony Fast Track book takes this approach: <a href="https://symfony.com/doc/6.2/the-fast-track/en/index.html" rel="nofollow">https://symfony.com/doc/6.2/the-fast-track/en/index.html</a>
Thought the question was regarding specific books that teach programming via small projects it's worth mentioning a related topic here.<p>A Common Sense Guide to Data Structures and Algorithms by Jay Wengrow * 2nd Edition * not only covers the theory really well but goes on to provide code examples in popular high level languages explaining when and how best to use them usefully. At the end of each section are prompts where you extend the lesson into a small project and each chapter builds on the last. The author has a github repo so you can compare your project solution to his. It made a rather dry topic extremely fun and approachable.
Most udemy/MOOC courses are structured this way. I tend to just look for the highest rated ones on whatever language I'm interested in and make sure it says build projects or something similar.
Write yourself a scheme in 48 hours by Johnothan Tang is a fantastic book, there's also the structure and interpretation of computer programs.<p><a href="https://upload.wikimedia.org/wikipedia/commons/a/aa/Write_Yourself_a_Scheme_in_48_Hours.pdf" rel="nofollow">https://upload.wikimedia.org/wikipedia/commons/a/aa/Write_Yo...</a><p><a href="https://web.mit.edu/6.001/6.037/sicp.pdf" rel="nofollow">https://web.mit.edu/6.001/6.037/sicp.pdf</a>
I recently finished the book that teaches programming by developing games using DragonRubyGameToolkit. Really loved this book.<p>_____<p><i>Python Crash Course</i> by Eric Matthes has a section dedicated to projects.<p>I really liked this book.<p>This is what taught me Python.<p>I knew C before.
>> one should start with small projects to build something real rather than learning rules and syntax of the language only.<p>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.
<a href="https://eloquentjavascript.net/" rel="nofollow">https://eloquentjavascript.net/</a> is nice and project based, it builds up from 0
<a href="https://shop.jcoglan.com/building-git/" rel="nofollow">https://shop.jcoglan.com/building-git/</a><p>This is an excellent resource.
While on the topic, how about any books or courses that teach building a 3D game engine from scratch? I'm language agnostic, so any language is fine.
Not quite programming but certainly covers the "small projects" part. This is what taught me the basics of Unreal Engine: <a href="https://www.youtube.com/watch?v=k-zMkzmduqI">https://www.youtube.com/watch?v=k-zMkzmduqI</a>
I have done courses on udemy like this before for learning new languages and tech stacks. There are plenty of courses on there that you can usually get for $20 that will teach you by building a bunch of small apps or services that build up in complexity.
This was just released, I haven't picked it up yet but it's definitely on my wish list<p><a href="https://www.manning.com/books/tiny-c-projects" rel="nofollow">https://www.manning.com/books/tiny-c-projects</a>
Learn Swift in 100 days. It start with the basics using Swift Playgrounds. But as soon as possible, it starts with building apps.<p><a href="https://www.hackingwithswift.com/100" rel="nofollow">https://www.hackingwithswift.com/100</a>
Same question, but not for beginners but for experienced programmers:<p>Which book would you recommend to improve architectural design decisions, developing complex systems, etc? But on actual examples, e.g. by building a series of projects, or parts of it?
Pretty much all of the books at newline do this: <a href="https://www.newline.co/" rel="nofollow">https://www.newline.co/</a>