- Software Design as a Deliberate Process: Ron Jeffries' attempts to build a Sudoku solver in 2006 are notable. He started with a simple
List[Option[Int]]
for the board and wandered, making small changes without much progress. Peter Norvig released a complete Sudoku solver in the same week with more clarity and a different chosen datatype (Map[Coord, Set[Int]]
). - Genres and Intuition in Programming: Norvig is a genre programmer focused on search, having written a book on AI. Jeffries is from the database application genre. His choice of
List[Option[Int]]
representation mimicked the Sudoku board presentation. His intuition worked well in his genre but was new in this context. - Jeffries' Second Sudoku Solver Attempt: His second attempt began with a
List[Option[Int]]
representation. His solution was serviceable but involved a lot of integer arithmetic. He later introduced aSet[Int]
representation and the notion of constraint propagation but didn't fully implement it due to performance issues. He then focused on search heuristics instead. - The Importance of Software Design: Software design requires deliberate effort. Jeffries' approach is myopic, preventing him from seeing the overall structure. Well-designed software has a narrative structure. Inconsistencies in Jeffries' solver code show the impact of not having a clear structure. Entropy creeps in even in small codebases.
Overall, the story of Ron Jeffries' Sudoku solver attempts highlights the differences between different programming genres and the importance of deliberate software design.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。