News for hackers. Stuff that matters.
Re:The Nature of Code (Book) by chaosprint on Tuesday April 25, 2023 @07:37AM (#35699047)
Great book. I got inspired by this book and the other one (https://www.cim.mcgill.ca/~clark/nordmodularbook/nm_algorith...) last year and made an logistic map function random notes example for the music programming language I created:

https://glicol.org/demo#chaos

Re:The Nature of Code (Book) by tromp on Tuesday April 25, 2023 @07:37AM (#35699046)
Given the contents:

    1. VECTORS
    2. FORCES
    3. OSCILLATION
    4. PARTICLE SYSTEMS
    5. PHYSICS LIBRARIES
    6. AUTONOMOUS AGENTS
    7. CELLULAR AUTOMATA
    8. FRACTALS
    9. THE EVOLUTION OF CODE
    10. NEURAL NETWORKS
a title "The Code of Nature" would also seem appropriate...
Re:The Nature of Code (Book) by beepbooptheory on Tuesday April 25, 2023 @10:42AM (#35701160)
Yes that is the play on words here! They are all aiming to simulate physical processes and such.
Re:The Nature of Code (Book) by tromp on Tuesday April 25, 2023 @12:18PM (#35702573)
Yep; they also could have gone with "Natural code", or "Code natural" ...
Re:The Nature of Code (Book) by thetrustworthy on Tuesday April 25, 2023 @07:54AM (#35699218)
The author said a 2nd edition will be out later this year: https://twitter.com/shiffman/status/1646961509833011201?s=20
Re:The Nature of Code (Book) by newswasboring on Tuesday April 25, 2023 @09:58AM (#35700565)
The homepage puts "Receive lifetime book updates for free", I guess that would mean second editions?
Re:The Nature of Code (Book) by shiffman on Wednesday April 26, 2023 @05:15PM (#35720118)
My intention is to send free digital updates to those who purchased the original 2012 PDF via the website, I have a list via fetchapp.com. I will probably remove this message for the new version. Print editions or other proprietary ebook formats (like kindle, etc) will be for purchase only for the new version. More: https://github.com/nature-of-code/natureofcode.com/pull/42
Re:The Nature of Code (Book) by archerx on Tuesday April 25, 2023 @08:01AM (#35699283)
Check out “coding train” on YouTube if you haven’t already. Love how he teaches coding, mistakes and all.
Re:The Nature of Code (Book) by afry1 on Tuesday April 25, 2023 @10:24AM (#35700932)
One of my absolute favorite YT coding channels, I will second that recommendation!

https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw

Re:The Nature of Code (Book) by autopilot23 on Tuesday April 25, 2023 @08:03AM (#35699299)
This is one of the first books I read when learning how to code :)
Re:The Nature of Code (Book) by phonescreen_man on Tuesday April 25, 2023 @08:33AM (#35699579)
Great author and one of the best teachers! This book is being rewritten to use JavaScripts p5js- original version is written for Java processing.
Re:The Nature of Code (Book) by macintux on Tuesday April 25, 2023 @08:33AM (#35699584)
Re:The Nature of Code (Book) by dang on Tuesday April 25, 2023 @01:24PM (#35703711)
Thanks! Macroexpanded:

The Nature of Code - https://news.ycombinator.com/item?id=23157721 - May 2020 (1 comment)

The Nature of Code – evolutionary and emergent properties of nature in code - https://news.ycombinator.com/item?id=19632361 - April 2019 (8 comments)

Generative Coding – “The Nature of Code” Ported to Three.js - https://news.ycombinator.com/item?id=18122940 - Oct 2018 (12 comments)

The Nature of Code (2012) - https://news.ycombinator.com/item?id=14410201 - May 2017 (16 comments)

The Nature of Code: Simulating Natural Systems with Processing [video] - https://news.ycombinator.com/item?id=13295139 - Jan 2017 (1 comment)

The Nature of Code - https://news.ycombinator.com/item?id=8060179 - July 2014 (15 comments)

Basics of Neural Networks with example codes and illustrations - https://news.ycombinator.com/item?id=6300510 - Aug 2013 (29 comments)

* The Nature of Code free online book with live examples* - https://news.ycombinator.com/item?id=5153895 - Feb 2013 (2 comments)

Daniel Shiffman launches "The Nature of Code" online for free - https://news.ycombinator.com/item?id=4709551 - Oct 2012 (11 comments)

Re:The Nature of Code (Book) by pgayed on Wednesday April 26, 2023 @05:10PM (#35720061)

  (map link-expander list-of-links)
I wonder what it looks like in Arc…
Re:The Nature of Code (Book) by dang on Thursday April 27, 2023 @12:42AM (#35723423)
There's a very old version at http://arclanguage.com/, but the current codebase isn't public.

FWIW, here's the Arc code I wrote to generate a string of the form "Italicized Title - https://news.ycombinator.com/item?id=num - Month Year (n comments)". The variable i stands for item, which is HN's term for a post (story, comment, or poll):

  (def biblioref (i)
    (let mon (monthdate (date i!time) 'short)
      (tostring
       (if (astorypoll i)
           (do (pr "*" (subst i!title "*" "\\*") "* - " (fullurl:item-url i!id)
                   " - " mon" (" (plural i!klive "comment") ")"))
           (do (pr (fullurl:item-url i!id))
               (unless (is mon (monthdate (date) 'short))
                 (pr " (" mon ")")))))))
Not that elegant but maybe not too bad.
Re:The Nature of Code (Book) by pgayed on Saturday April 29, 2023 @05:30AM (#35751442)
I like it!

Here's one I use to decide from a list of free-form submissions whether to generate a link or a Google search:

  (fn [pair-of]
    (let [text (get pair-of 1)]
      (cond 
        (clojure.string/starts-with? text "http")
          (list [:a {:href text} (truncate text 60)] [:br])
        :else (list [:a {:href (str "https://google.com/search?q=" text)} text] [:br]))))
Doesn't always work but works often enough! ;)
Re:The Nature of Code (Book) by iknownothow on Tuesday April 25, 2023 @08:34AM (#35699597)
If you're a beginner absolutely give it a try!

I implemented all of the book almost 10 years ago in Python and pygame. I was starting to code professionally back then and it is responsible for much of the confidence I needed. It definitely is more about nature and math than code. If you're the kind of hands on learner like I am, then I'd recommend using this as a resource to learn to code first before learning about theorectical data structures. Thanks to the author, I am now in a position to buy it :)

Re:The Nature of Code (Book) by grungegun on Tuesday April 25, 2023 @10:32AM (#35701044)
Loved this book.

When I first started programing, I was convinced that text applications weren't real programs, and the visual aspect of the book pulled me in to be a life-time programmer :)

Re:The Nature of Code (Book) by who-shot-jr on Tuesday April 25, 2023 @12:17PM (#35702549)
Daniel Shiffman is amazing! An excellent teacher.
Re:The Nature of Code (Book) by sumanmichael on Tuesday April 25, 2023 @02:11PM (#35704398)
Such a lovely book. Try it, go fall in love with nature -o-f- and code.
Re:The Nature of Code (Book) by rramadass on Wednesday April 26, 2023 @01:23AM (#35709877)
I think this book should be used to teach "Programming" (in any language) in School because it shows how to use Computers as an aid to actually learning/simulating Science which dovetails nicely with the Maths/Physics/Chemistry/Biology classes.

Teaching this way will actually motivate students to understand Science since they can program the evidence and convince themselves of the "Scientific Truth" of what they have studied.

Re:The Nature of Code (Book) by bj-rn on Wednesday April 26, 2023 @10:25AM (#35714136)
If you like this book you might also like Generative Gestaltung / Generative Design:

http://www.generative-gestaltung.de

Re:The Nature of Code (Book) by shiffman on Wednesday April 26, 2023 @04:37PM (#35719635)
Hi! I'm the author, excited to find this post here. I am working furiously on a new version of the book, if you want to see it in progress there is a preview site here: https://nature-of-code-2nd-edition.netlify.app/

More: https://github.com/nature-of-code/noc-book-2023