Logic for Programmers

(logicforprogrammers.com)

92 points | by _doctor_love 6 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 40 minutes 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 2 minutes ago
      How are Gödel's incompleteness theorem relevant to the working programmer?
  • Merkur 1 hour 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 39 minutes 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 4 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 42 minutes 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.
  • richardbarosky 1 hour ago
    Thank you for sharing, really appreciate Hillel's content!
  • altmanaltman 2 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 23 minutes ago
    [flagged]
  • fenestella 3 hours ago
    [flagged]