Logic for Programmers

(logicforprogrammers.com)

99 points | by _doctor_love 7 hours ago

8 comments

  • rmunn 3 hours ago
    Back when I was in college, I took some philosophy classes just for fun. I discovered when I took Symbolic Logic that while everyone else was struggling with the class, I was finding it pretty easy, because chaining together a proof in symbolic logic felt just like programming. It was the same mental steps: you have the starting conditions, there's an endpoint you want to reach, and you need to chain together these fundamental operations in order to get there. (And sometimes you needed to see how to break them apart: if you need to prove P AND Q, then proving P separately and proving Q separately were usually easier steps, and then once you've proved P and you've proved Q then you've proved P AND Q. Which felt a lot like refactoring a large function that did two things into two separate, smaller functions that do one thing each).

    Looking through the sample chapter, I'm reminded of my experience with symbolic logic class. It looks like it'll be much the same thing, but flipped on its head: instead of knowing programming and using that knowledge to make symbolic logic easier, this looks like it'll be about knowing symbolic logic and using that knowledge to make programming easier. Seems pretty useful; I'll give the sample chapters a more in-depth read soon.

  • kriro 1 hour ago
    Looking at the table of contents, I see no mention of Gödel/incompleteness theorems or limitations which is not a great sign. It does look well structured though but I'd probably recommend just going with "Introduction to Logic" by Tarski and "Metalogic. An introduction to the metatheory of standard first order logic." by Hunter. Those served me well and are fairly understandable for a non-mathematician (imo).

    Alternatively hop straight into Prolog (Art of Prolog, Craft of Prolog).

    • fmajid 25 minutes ago
      How are Gödel's incompleteness theorem relevant to the working programmer?
  • Merkur 2 hours ago
    I read the free part. Looks interesting, but the math heritage is dominant as promised.

    It seems to favor the compact and efficient kind of code that is brittle in the hand of a mildly competent junior dev, or a heavy multitasking senior.

    I like smart code, in fun projects, but on the job I prefer fast to read and to reason code. Don’t try to be fancy.

    So I guess that’s a book to challenge my assumptions. I like that. Thx.

    • jpollock 1 hour ago
      I know that as Kernighan's Law. Seems to be something that seniors learn over time.

      https://github.com/dwmkerr/hacker-laws#kernighans-law

      "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?"

      • dwattttt 27 minutes ago
        I took some time to think about why this saying bugs me, and I think I've settled on "it suggests you can't understand your limits".

        I know it's explaining the joke, but you've blown past "clever" if you've reached the point where you can't debug it.

  • theusus 1 hour ago
    The problem I see with the book is copy editing. It is self published on lean pub, which I have seen has poor copy editing.
    • harperlee 12 minutes ago
      FWIW, I'm on the email list of Hillel, and when discussing that the book is done, he said the following, which makes me thing otherwise:

          This marks the completion of a project that took five years of work, six bookwriting professionals, fourteen domain experts, and fifteen public alphas.
      
          This has been, without a doubt, the biggest and most exhausting project I've ever done. The examples in the discarded drafts alone could make a second book. The cursed knowledge I've gained on LaTeX and typography could fill a third (or at least a couple of entertaining blog posts). Self-publishing was simultaneously the worst and best decision I made.
      
          Now excuse me I am going to sleep for a month.
  • richardbarosky 1 hour ago
    Thank you for sharing, really appreciate Hillel's content!
  • altmanaltman 3 hours ago
    The footer say HTML code generated by Claude. But who did the css? and who did the js? Tangentially, is html code the correct term if all of it is in a single file or is it still html + css + js code seperately in a single file?
  • sqemo 46 minutes ago
    [flagged]
  • fenestella 3 hours ago
    [flagged]