Live data from Hacker News

Ask HN: Books that teach programming by building a series of small projects?

news.ycombinator.com

171–180 of 204 posts

Re: Ask HN: Books that teach programming by building a series of small projects?

#171

While not for beginners, if you'd like to learn rust I recently finished "Command line Rust" [1]. 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. The book also…

Glad we can buy the book standalone without getting a membership to O'Reilly.

Re: Ask HN: Books that teach programming by building a series of small projects?

#173
post #125

Earlier quoted context omitted.

I've been learning lisp this past week. I think I get the main idea of "code is data and data is code", but I struggle to understand how it's more powerful than, say, making a function factory in Python.

Not sure what you mean by "function factory", could you elaborate? Isn't it metaclasses and decorators that are used for metaprogramming in Python? In my opinion the 'everything is an expression' is the really tasty part of the lisps, which goes well with quoting.

My naive interpretation of `defmacro` is passing data into a function to return another function. From my python POV that would be the same as returning a callable from a function (decorators being one example).

I think top comment does a good job explaining that while I'd get the same functional result, Python objects have tons of abstraction behind them that make them harder to work with than lisp combinations.

Re: Ask HN: Books that teach programming by building a series of small projects?

#174

While not for beginners, if you'd like to learn rust I recently finished "Command line Rust" [1]. 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. The book also…

Glad we can buy the book standalone without getting a membership to O'Reilly.

I may sound like a shill but I think paying for O'Reilly is worth it. You get access to many books and videos outside the O'Reilly publisher. Definitely worth it, I tend to read a tech book a month (maybe 2 if it's "light.")

Many of the books being suggested in the other comments are available as well (will definitely start Hands-On Rust because it seems very cool, and Practical Common Lisp shortly afterwards).

Out of all the "tutorial" offerings I only pay for three services:

O'Reilly (four years so far)

Educative.io (two years)

Frontendmasters (eight years)

Every year I test out other services (pluralsight, lynda/linkedin learning, egghead, etc) but outside of one or three core offerings they don't seem to be a good value for what I want.

Re: Ask HN: Books that teach programming by building a series of small projects?

#175
post #40

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. https://www.goodreads.com/en/book/show/927128.Mud_Game_Progr...

I build MUDs whenever I learn a new language! Didn't know there was a BOOK for it! Wow. Very cool!

Re: Ask HN: Books that teach programming by building a series of small projects?

#176
post #126

Earlier quoted context omitted.

I've been learning lisp this past week. I think I get the main idea of "code is data and data is code", but I struggle to understand how it's more powerful than, say, making a function factory in Python.

I used to have the same issue understanding the benefit. One simple example that helped it clicked for me was considering the `when` or `unless` macro. They're just very simple macros based around the `if` special form. Because they're macros, they can just treat the body as data, i.e. it's not executed as part of argument resolution. If you wanted to make a `when` function in Python, the "body" would have to be a ca…

So let's say i have a lisp macro along the lines of

(analyze 1 2 expensiveComputation)

In python, to prevent evaluating all arguments when running analyze, I'd have to pass expensiveComputation as a callable or a function partial and remember to call it if I need it.

Whereas in lisp, I can pass whatever expensive variable I want into the macro because it will only get evaluated when using (expensiveComputation ...) and that's baked into the language.

Re: Ask HN: Books that teach programming by building a series of small projects?

#177

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…

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 th…

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 :)

Re: Ask HN: Books that teach programming by building a series of small projects?

#178

The famous Structure and Interpretation of Computer Programs (SICP) does this, in the Scheme language. The whole book is online here, with the table of contents right at the front: https://web.mit.edu/6.001/6.037/sicp.pdf

There’s a JS edition too

And a 'comparison' edition

https://sicp.sourceacademy.org/

Re: Ask HN: Books that teach programming by building a series of small projects?

#180
> 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.

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.

Post reply on HN