
The Nature of Code
by Daniel Shiffman · first published 2012
111mentions
73recommended by
82HN commenters
2012–2026first – last mentioned
89% recommend10% neutral1% critical
Why HN recommends it
Free, engaging introduction to simulating natural systems in code, covering physics, math, L-systems, genetic algorithms and neural networks via Processing and p5.js; suits programmers who like seeing visual results.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








This is a great resource by Daniel Shiffman. For those who don't know, The Nature of Code was a kickstarter project[0] (he also wrote "Learning Processing" a while ago), and I've contributed to it for the following reason: I've been around people in the arts field a lot, and when it comes…
on “The Nature of Code” ↗…the Hierarchical temporal memory (https://en.wikipedia.org/wiki/Hierarchical_temporal_memory) model for ANNs: https://www.youtube.com/playlist?list=PL3yXMgtrZmDqhsFQzwUC9... Dan Shiffman's series "The Nature of Code: Simulating Natural Systems with Processing": https://www.youtube.com/user/shiffman/playlists?shelf_id=6&s...
on “The Essence of Linear Algebra [video]” ↗…time. Very simple IDE. All Java is valid Processing. Also, you can make Android apps with it. It's very closely related to Arduino development, too. www.processing.org. Daniel Shiffman's books are great. Nature of Code is free online.
on “Ask HN: Getting back into programming with a hacker’s mindset?” ↗The Nature of Code - Daniel Shiffman
on “Crafting Interpreters: A Review” ↗You can submit a pull request ;) https://github.com/shiffman/The-Nature-of-Code I think that's so amazingly awesome, that it can evolve as a living document in this way.
on “Basics of Neural Networks with example codes and illustrations” ↗I'm a recent fan of Daniel Shiffman. I just finished "The Nature of Code" the other day and can say that it was the first programming book that I didn't want to end. Glad to see him doing more teaching.
on “Processing Hour of Code” ↗…crossplatform, and comes packaged as one self-contained file to download and execute. It is the quickest to start with in my opinion. Jason Levine has ported the code from Daniel Shiffman's book, The Nature of Code book to Extempore's xtlang [4]. A great way to learn Extempore. Livecoding seems to be growing more and more with a lot of hardware toys to go along with it. Exciting times. [1] http://extempore.moso.com.au/…
on “Aerodynamic by Daft-Punk in 100 lines of code with Sonic Pi” ↗…backgrounds? The 3D plane holds so much possibility for drawing on other disciplines. Also daniel shiffman has some absolutely deranged and highly caffeinated intros in various flavors of js- his series "the nature of code" is very magnetic and accessible and his clumsy exuberant vibe is good for busting imposter syndrome.
on “Ask HN: I'm looking for a good book on the fundamentals of CS” ↗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…
on “The Nature of Code (2nd Edition)” ↗…would recommend a variety of books like Inside the Machine by Stokes, Computer Architecture by Hennessy, 21st Century C by Klemens, Crafting Interpreters by Nystrom, Compilers by Aho, Effective Java, Nature of Code by Shiffman, Ray Tracing Challenge by Buck, Hands on Hacking by Hickey, and others, depending on your interest and area of focus.
on “Ask HN: What books should I read to improve as a software engineer?” ↗…recommend: * shadertoy [0] and Inigo Quilez [1] * Amy Goodchild [2] * Oleg Dolya aka watabou [3] (author of Pixel Dungeon [4]) * r/proceduralgeneration [5] * Daniel Shiffman aka The Coding Train [6], Nature of Code [7] * OpenProcessing [8] Any more recommendations? [0] www.shadertoy.com [1] iquilezles.org [2] www.amygoodchild.com [3] watabou.github.io [4] watabou.itch.io/pixel-dungeon [5] www.reddit.com/r/proceduralgeneration…
on “Ask HN: Procedural generation, creative coding artists / communities / resources” ↗For those interested, see Daniel Shiffman's Nature of Code[1], a book in which you go from simple "ant" simulations to machine learning, neuroevolution, and NEAT using p5.js for graphics. [1]: natureofcode.com
on “Collatz’s Ant” ↗For those interested, see Daniel Shiffman's Nature of Code[1], a book in which you go from simple "ant" simulations to "boid" flocking behaviors, and from physics simulation to machine learning, neuroevolution, and NEAT using p5.js for graphics. [1]: natureofcode.com
on “Boids, an artificial life program, which simulates flocking behavior of birds” ↗…Proxmox. It's more of a hardware and cable routing project right now but I'm excited to move towards setting up the software side of things soon! I'm also learning JavaScript through Daniel Shiffman's book Nature of Code. As someone who has a background in modeling it's a very engaging read, and the exercises are fun!
on “Ask HN: What are you working on? (February 2025)” ↗The Nature of Code by Daniel Shiffman is an excellent entry point - it teaches fundamentals of physics simulations with clear examples in Processing/p5.js.
on “Ultrathin business card runs a fluid simulation” ↗