Live data from Hacker News

The Sudoku Affair

explaining.software

21–30 of 45 posts

Re: The Sudoku Affair

#21
post #12

Good article. For me, this is the fundamental concept: > Both Norvig and Jeffries are genre programmers; they have spent most of their career solving a specific kind of problem. And that problem, inevitably, lends itself to a particular kind of solution. I wish more people would be circumspect about the genre of problem they're trying to solve and how their framing railroads them into a particular type of solution th…

> I wish more people would be circumspect about the genre of problem they're trying to solve and how their framing railroads them into a particular type of solution that might have a better method.

Do you mean "explicit?" "Circumspect" seems like not what you want.

Re: The Sudoku Affair

#22
post #20
post #9

Earlier quoted context omitted.

It's specifically about the limits of incremental design. TFA's thesis is roughly that incremental design dooms you to a local maximum: Since Jeffries (the TDD/Sudoku guy you seem to be aware of) starts out with a suboptimal representation for the board, there is no small change that can turn the bad code into good code. At some point along the line, he makes motions in the direction of the design that Norvig used, b…

Thanks! Annoyed that the link still isn't loading for me. I'm curious on the thesis. I'm assuming "locked in by tests" increments are the problem? I'm curious why you couldn't treat this like any learning task where you can take efforts that are effectively larger steps to see where they can get you? I should also note that I am not clear I understand how bad of a representation of the board you could get locked with…

> I'm curious on the thesis. I'm assuming "locked in by tests" increments are the problem? I'm curious why you couldn't treat this like any learning task where you can take efforts that are effectively larger steps to see where they can get you?

Here's a quote from TFA on this (using >> for quotes from TFA)

>> But Jeffries isn't in the business of starting over. He not only believes in incremental design, but in using the smallest possible increments. In his posts, he regularly returns to GeePaw Hill's maxim of "many more much smaller steps." He is only interested in designs that are reachable through a series of small, discrete steps:

and later

>> Jeffries, however, does not believe in bigger pictures; his approach to software design is proudly myopic. He prevents himself from seeing the forest by pressing his face against the trees.

> I should also note that I am not clear I understand how bad of a representation of the board you could get locked with. I got a working solver years ago with what is almost certainly a poor representation. https://taeric.github.io/Sudoku.html

First a point of clarification; Jeffries also gets a working solver; not in the original episode you may have heard of but in a series of forty-five articles 18[1] years after the infamous incident; TFA focuses almost entirely on this (successful) attempt.

Once Jeffries has a working solver he attempts to simplify it, and TFA makes the claim that these attempts are hindered by the choice of Option[Int] for each cell rather than a Set[Int] (i.e. a set of remaining legal values). This results in Norvig's code being significantly more succinct than Jeffries' code, even when implementing the same heuristic.

1: This originally read "two" due to quick skimming on my part.

Re: The Sudoku Affair

#23
post #17

Earlier quoted context omitted.

Was that for Yore?

Um, yeah. How do you know the name? I have never mentioned it by name, I think. Only linked to it occasionally. Edit: Another reason I am surprised is that Yore became its name only a few months ago.

I'll admit I had to search for the name. I recognized your username as "that Yao guy" and remembered that you were also working on a build system and VCS. Since yore is in the same repository of yao, it wasn't hard to find.

Re: The Sudoku Affair

#24
post #23

Earlier quoted context omitted.

Um, yeah. How do you know the name? I have never mentioned it by name, I think. Only linked to it occasionally. Edit: Another reason I am surprised is that Yore became its name only a few months ago.

I'll admit I had to search for the name. I recognized your username as "that Yao guy" and remembered that you were also working on a build system and VCS. Since yore is in the same repository of yao, it wasn't hard to find.

Ah, cool!

Re: The Sudoku Affair

#25
post #22
post #20

Earlier quoted context omitted.

Thanks! Annoyed that the link still isn't loading for me. I'm curious on the thesis. I'm assuming "locked in by tests" increments are the problem? I'm curious why you couldn't treat this like any learning task where you can take efforts that are effectively larger steps to see where they can get you? I should also note that I am not clear I understand how bad of a representation of the board you could get locked with…

> I'm curious on the thesis. I'm assuming "locked in by tests" increments are the problem? I'm curious why you couldn't treat this like any learning task where you can take efforts that are effectively larger steps to see where they can get you? Here's a quote from TFA on this (using >> for quotes from TFA) >> But Jeffries isn't in the business of starting over. He not only believes in incremental design, but in usin…

> two years after the infamous incident

Actually 18 years later.

Re: The Sudoku Affair

#26
post #25
post #22

Earlier quoted context omitted.

> I'm curious on the thesis. I'm assuming "locked in by tests" increments are the problem? I'm curious why you couldn't treat this like any learning task where you can take efforts that are effectively larger steps to see where they can get you? Here's a quote from TFA on this (using >> for quotes from TFA) >> But Jeffries isn't in the business of starting over. He not only believes in incremental design, but in usin…

> two years after the infamous incident Actually 18 years later.

Thanks, that's right; it's two years after an interview that was fifteen years later. Fixed.

Re: The Sudoku Affair

#28

Hilarious post. I recommend people read to the end > If Jeffries started with a different core representation, then it's likely his subsequent design decisions would also change. The bookkeeping for constraint propagation might push him towards Norvig's relational approach to the rules of Sudoku; rather than continually recomputing the rows, columns, and boxes, he could simply have a map of each cell onto its peers.…

> In software we have the luxury of rethinking from first principles

What does this even mean? I'm aware of the meaning of "first principles" and it doesn't seem to relate at all to software development at all. I can imagine using this when trying to figure out how code works, but I can't figure out how it relates to building the software to begin with. What questions are you trying to answer where first principles would even come up?

Re: The Sudoku Affair

#29
post #21
post #12

Good article. For me, this is the fundamental concept: > Both Norvig and Jeffries are genre programmers; they have spent most of their career solving a specific kind of problem. And that problem, inevitably, lends itself to a particular kind of solution. I wish more people would be circumspect about the genre of problem they're trying to solve and how their framing railroads them into a particular type of solution th…

> I wish more people would be circumspect about the genre of problem they're trying to solve and how their framing railroads them into a particular type of solution that might have a better method. Do you mean "explicit?" "Circumspect" seems like not what you want.

From Wiktionary [0]:

> Carefully aware of all circumstances; considerate of all that is pertinent.

"I wish more people would put more consideration of all that is pertinent about the genre of problem they're trying to solve and how their framing railroads them ..."

[0] https://en.wiktionary.org/wiki/circumspect

Re: The Sudoku Affair

#30
Slightly off topic, but this made me think of an example from the PuLP (Python Linear Programming library) that solves a sudoku using LP constraints.

https://coin-or.github.io/pulp/CaseStudies/a_sudoku_problem....

One nice thing about this approach is that by adding each solution in as a constraint and re-running, you can exhaustively enumerate all possible solutions for a given puzzle.

Post reply on HN