Live data from Hacker News

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

news.ycombinator.com

121–130 of 204 posts

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

#121

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

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

#122

HTDPv2 https://htdp.org/ - it's about learning to program rather than teaching a specific language. 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). Anyway, i could write tons of…

Interesting, I rarely see it mentioned. How do people react to the mindset it teaches ? I really like that it's near language-less programming book, really more about and/or :)

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

#123

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…

Just to clarify, when you say "not for beginners" do you mean beginners to Rust or programming in general?

edit: Based on your "It was my first introduction to rust" comment I think maybe you meant programming beginners?

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

#124

My favourite is "Practical Common Lisp" by Peter Seibel ( https://gigamonkeys.com/book/ ) 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 tru…

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'm also learning lisp, mainly as a part of learning emacs, so I may not be super accurate here. In python, when you have a reference to a function, its a bit opaque, you can tell the thing is a function, but I don't think you can really go into the function object, and alter it lets say. You may be able to using the AST or something, but its not a "first-class" thing you can do.

In lisp (and code is data, data is code), the function is also a list, so you would be able to use all the normal programming tools to iterate over the list, add new items to the list, etc, which can change how the function runs.

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

#125

My favourite is "Practical Common Lisp" by Peter Seibel ( https://gigamonkeys.com/book/ ) 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 tru…

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.

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

#126

My favourite is "Practical Common Lisp" by Peter Seibel ( https://gigamonkeys.com/book/ ) 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 tru…

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 callable like a lambda or named function.

I know this probably isn't the most compelling use case but I found it to be a really simple way to understand some of the benefits of macros and how they could be used elsewhere.

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

#128
post #115

Earlier quoted context omitted.

There are many, but the field is still wide open. Anyone with a particular domain experience should find a market. There 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…

Prefix each line with two spaces, per the formatdoc page [0] [0] https://news.ycombinator.com/formatdoc 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.")

Thanks!

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

#129
I like “The Elements of Computing Systems: Building a Modern Computer from First Principles”.

You build a whole computer from scratch through small projects.

Sure, you want learn a specific language, but you’ll grock programming in general.

Post reply on HN