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.
https://lets-go-further.alexedwards.net
That book is a follow-up to an easier book [1] that I also bought, but ended up skipping since I was only interested in writing JSON APIs.
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.
That's what I tell everyone
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.
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.
Proj-based learning is really fun to both create and consume imo.
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.
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.