[HN Gopher] The Nature of Code (2nd Edition)
       ___________________________________________________________________
        
       The Nature of Code (2nd Edition)
        
       Author : skilled
       Score  : 428 points
       Date   : 2024-05-01 09:15 UTC (3 days ago)
        
 (HTM) web link (natureofcode.com)
 (TXT) w3m dump (natureofcode.com)
        
       | skilled wrote:
       | As per this tweet[0], the 2nd edition was finished on April 20th,
       | 2024. There's a GitHub repo[1], and there have been a few HN
       | discussions over the years[2] (dating back to 2014 (book was
       | released in 2012)), but none that had discussion above ~30
       | comments.
       | 
       | [0]: https://twitter.com/shiffman/status/1781689870466916655
       | 
       | [1]: https://github.com/nature-of-code/noc-book-2
       | 
       | [2]:
       | https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
        
         | pvg wrote:
         | A formatted list of previouslies
         | 
         | https://news.ycombinator.com/item?id=35703711
        
       | BigAlan09 wrote:
       | My final year dissertation focused on Genetic Algorithms, where I
       | implemented an ecosystem of herbivores, carnivores, and omnivores
       | (referred to as "blobs," similar to those described in this
       | book). The title of the paper was "Simulating Adaptation by
       | Natural Selection Using Genetic Algorithms." It was a really fun
       | project, and I learned a great deal from it. This book would have
       | been handy at the time, as the only resources I had were Craig
       | Reynolds's Boids. I conducted my research and simulation back in
       | 2009. One day, I will attempt the simulation again, utilizing the
       | knowledge from this book, particularly the neural networks to
       | give the blobs a "brain," and the experience I have gained since
       | then. You've got yourself a buyer!
        
         | jasonb05 wrote:
         | Love it!
         | 
         | I built a similar alife simulation but as a Quake 2 mod using
         | the monsters as the agents and plants and stuff with neural
         | nets and genetic algorithms. My piece was titled "Ecosystem:
         | Constructing a simple self-perpetuating society of adaptable
         | agents" [1].
         | 
         | This was 2003, not for school but for fun. I submitted it for
         | an ai writing comp on ai-depot.com but the comp failed for lack
         | of entries. I have some pics on a repo backup of the project
         | [2].
         | 
         | Agreed, "nature of code" looks like fun!
         | 
         | [1]:
         | https://web.archive.org/web/20080624004102/http://www.ict.sw...
         | 
         | [2]:
         | https://github.com/Jason2Brownlee/HumanDebrisArchive?tab=rea...
        
       | sweetheart wrote:
       | The first edition of this book played such a huge role in me
       | learning to program, and thus set the stage for (likely) the rest
       | of my life. Daniel Shiffman has probably had that influence on
       | many, many, many people. To this day, I recommend p5.js as a
       | starting place for learning programming, and then picking up The
       | Nature of Code once all the basics make sense and the newly-
       | minted programmer is ready for some bigger challenges.
       | 
       | Very excited to own a physical copy of this new edition to always
       | warmly look back on! :)
        
         | alabhyajindal wrote:
         | Any thoughts on what role creative coding plays in the overall
         | software engineering field? Is it done for recreation and art?
         | Do people use it to create and sell products as well?
         | 
         | I love watching and working through The Coding Train videos!
         | One reason why I haven't gone deep into creative coding is I
         | don't know where I'll use it.
        
           | simulo wrote:
           | I guess mainly recreation and, particularly, teaching.
        
           | ingenieros wrote:
           | Google has a Creative Lab which employs a handful of creative
           | coders who primarily work with emerging tech on experimental
           | projects. They also offer a one year paid fellowship to young
           | grads to join their labs in either NY or London:
           | https://www.creativelab5.com/
           | 
           | Creative coding is everywhere these days. From the parametric
           | architecture of Zaha Hadid and MAD architects to procedurally
           | generated furniture designs and jewelry. https://n-e-r-v-o-
           | u-s.com/projects/
        
           | sweetheart wrote:
           | I use it for making art! Specifically static, 2D "paintings"
        
           | relaxing wrote:
           | Designing and building effective data visualizations is a
           | pretty large practical application.
        
           | doctorhandshake wrote:
           | While I don't use the term, it's applicable to what I do as a
           | career. I like to say I make installations, objects, and
           | experiences with complex inner lives. Sometimes I add the
           | word 'digital' in there. Many who do what I do describe
           | themselves as 'creative technologists' because code is but
           | one part alongside experience design, art direction,
           | fabrication, systems design, and electrical engineering.
        
           | ralusek wrote:
           | Technical Artist would be the primary role. ShaderToy and
           | other such resources for shader programming. Extremely
           | creative field.
        
         | simulo wrote:
         | I read his "learning processing" many years ago. It was the
         | book that made programming made sense to me. The explanations
         | are excellent, the outcomes interesting and it helped me to see
         | why object orientation makes sense after fruitless attempts of
         | understanding it using examples of different types of cars that
         | print "wrooom wroom" to the terminal.
        
       | polytely wrote:
       | Loved the first edition of this book and am also a big fan of the
       | youtube channel of the author, the Coding Train.
       | 
       | https://www.youtube.com/watch?v=p7IGZTjC008
        
       | Nekorosu wrote:
       | The second edition of one of the best books at the crossroads of
       | art-making and coding!
        
       | liendolucas wrote:
       | The challenges videos from The Coding Train are super
       | entertaining to watch. It all feels like a joke, having Daniel
       | Shiffman performing all sorts of hilarius acts and explanations.
       | By the end of a video you have not only laughed all along but
       | most importantly you have learnt something interesting in a
       | simple and entertaining way. I would love to purchase the CHOO-
       | CHOO flute that Mr. Shiffman sounds from time to time (if
       | engraved with the coding train logo, better) but unfortunately is
       | not available for purchase in their online store.
        
       | deigan wrote:
       | Glad to see it's done.
       | 
       | As a philosopher with only a bit of programming background (and
       | previously no javascript), this was very helpful for getting some
       | simulations online in a format easy for my students and others to
       | play around with:
       | 
       | https://mikedeigan.com/the-cursor/posts/2022/skyrmsian-signa...
        
       | j0hnyl wrote:
       | What is new in the 2nd edition?
        
         | philomathdan wrote:
         | Just glancing through it, it looks like the 2nd edition uses
         | p5.js instead of Processing, and there's an additional chapter
         | entitled "Neuroevolution."
        
         | shiffman wrote:
         | Chapter 6 is also revamped (to use matter.js) and other
         | chapters include expanded / revised examples and explanations.
         | Chapter 10 was almost entirely re-written, Chapter 11 is new.
        
           | j0hnyl wrote:
           | Thanks Dan! The first edition of your book sits on my desk
           | for inspiration and has become a creative reference for me.
           | It was actually a nice exercise to convert everything to p5js
           | for me. Thanks for keeping us informed and entertained over
           | the years!
        
       | rancevent wrote:
       | I read this book when I was in high school and it played a major
       | role in shaping my interests in programming and math. Highly
       | recommend it.
        
       | who-shot-jr wrote:
       | Daniel Shiffman is a legend! love his teaching style.
        
       | surajama wrote:
       | The first edition was absolutely critical in helping me
       | understand how to program anything more than simple scripts. I
       | got hooked into the physics simulation portion and created a
       | pretty fun Asteroids-inspired game.
       | 
       | Although OOP is going out of style, I think learning it is super
       | important to understand how you can use layers of abstraction to
       | build increasingly complex programs.
        
       | atum47 wrote:
       | I've learned so much from watching Daniel's videos on YouTube.
       | They are also very entertaining. Always featuring a cool
       | algorithm that you usually don't know exists. Great work!
        
       | raincole wrote:
       | The first edition is one of my favorite programming books. I'm
       | not a big fan of youtube coding tutorials, and glad to see the
       | author is still updating the bood instead of devoting to the
       | youtube channel.
        
       | hbbio wrote:
       | Super interesting topic and awesome book overall!
       | 
       | I may be nitpicking, but any teaching material with JavaScript
       | poor coding practices can hurt both humans and LLMs.
       | 
       | 1. When you don't reassign a variable it's a `const`
       | 
       | 2. for (let i = 0; i < total; i++) { randomCounts[i] = 0; } is
       | `new Array(total).fill(0)`
       | 
       | etc.
        
         | rrherr wrote:
         | https://www.joshwcomeau.com/javascript/the-const-deception/
        
           | ralusek wrote:
           | I don't get this argument. const means you can't reassign the
           | variable, that's it. If you don't plan on reassigning the
           | variable, use const. In the rare places that you don't use
           | const, you're telling me that you reassign the variable
           | somewhere.
           | 
           | I don't understand why people need const to be something it's
           | not. The fact that you can still mutate objects is because in
           | js, an object assigned to a variable is best thought of as a
           | pointer to a value in the heap. const means the variable
           | won't reassign the reference, Object.freeze means the
           | referenced data can't change. Both useful, both different use
           | cases; needn't be conflated.
        
       | solarized wrote:
       | HN thread never fails to blow my mind. Delightful books to
       | showing programming and science as an art !
        
       | guiambros wrote:
       | I'm a big fan of Dan Shiffman, and got the first Nature of Code
       | through his Kickstarter project in 2012 [1].
       | 
       | Even if you are an advanced programmer, there's something magical
       | about Dan's style and his ability to explain concepts in a simple
       | way. Also perfect to get kids started in programming.
       | 
       | The book is available for free online, but if you can afford,
       | it's a great addition to your (physical) bookshelf.
       | 
       | [1] https://www.kickstarter.com/projects/shiffman/the-nature-
       | of-...
        
       | benrutter wrote:
       | Such a great book- really happy to see it on the front page!
       | 
       | The book website shows a beautiful hardback copy of the book, is
       | this real? Are there plans to do a printrun? (I can't find
       | anything on the website mentioning it aside from the picture)
        
         | shiffman wrote:
         | The book is going to have a print run and is available for pre-
         | order right now! It's being published by No Starch Press. The
         | hardcover, however, is a mock-up, it will be a flexi-bound
         | softcover.
        
           | benrutter wrote:
           | Amazing! Congrats on finishing the second edition and thanks
           | for so many great resources.
        
       | Benedicht wrote:
       | Loved the first edition, it delved into a lot of interesting
       | topics in an easy to understand way.
        
         | nindalf wrote:
         | Delved, you say?
        
       | rramadass wrote:
       | I am forever indebted to this book for pointing me to Valentino
       | Braitenberg's _Vehicles: Experiments in Synthetic Psychology_
       | (https://mitpress.mit.edu/9780262521123/vehicles/) where very
       | simple autonomous sensor/actuator machines combine to exhibit
       | complex behaviour which maybe mistaken for "Intelligence". Makes
       | you really think abut Complexity/Intelligence/Emergent
       | Behaviour/etc.
       | 
       | Wikipedia : https://en.wikipedia.org/wiki/Braitenberg_vehicle
       | 
       | Some Videos:
       | 
       | https://www.youtube.com/watch?v=DFXZc54_4GY
       | 
       | https://www.youtube.com/watch?v=A-fxij3zM7g
        
       | pcarolan wrote:
       | Daniel Shiffman taught me to code for the first time in a way
       | that totally shifted the way I thought about coding from
       | utilitarian to fun and creative. I wonder how many lives he's had
       | this impact on. Good on you sir.
        
         | AndrewDavis wrote:
         | I remember discovering his Youtube channel, it was either
         | during my first year of University and i'd watch them as much
         | for entertainment as education. Every so often i'd find myself
         | following along.
         | 
         | Between semesters I watched some of his search algorithm
         | videos, including his two part A* videos, and recreated it.
         | When semester started I took a classical AI course and the
         | first assignment was search algorithms. And my goodness was it
         | helpful.
        
       | shiffman wrote:
       | Just wanted to pop in and say hi here! Delighted to discover this
       | thread, it's been quite the adventure trying to get this new
       | version of the book finished. Happy to answer any questions about
       | the book here! Thanks for the support and kind feedback.
        
         | nnnnico wrote:
         | Thanks for your work Daniel!
        
         | multiplied wrote:
         | Thank you so much for your content over the years. It is
         | genuinely a feel good experience but also full of substance. It
         | is genuinely enjoyable and the topics are really fun.
         | 
         | The youtube videos are amazing and also love the book and its
         | presentation! Thank you for putting out such genuinely feel
         | good and positive content.
        
         | diegof79 wrote:
         | Thank you so much, Dan! I enjoyed the first edition and your
         | Coding Train videos.
         | 
         | Fantastic work and way of teaching.
        
       | NoobSaibot135 wrote:
       | Love coding train YouTube channel!
       | 
       | This guy is funny, knowledgeable and not full of himself (unlike
       | others in our industry)
       | 
       | Learned a ton from Daniel when I was starting out
        
       | maxwelljoslyn wrote:
       | I _adore_ this book. A second edition?! Boy howdy is that
       | exciting. Thanks so much Daniel!
        
       | gaurav1969 wrote:
       | Can someone share here the pdf of the 2ed of the book. Thanks, I
       | don't know how. To make a PDF from GitHub by code
        
       ___________________________________________________________________
       (page generated 2024-05-04 23:00 UTC)