news.volyx.in

Advent of Code 2024 in pure SQL (databasearchitects.blogspot.com)

484 points by greghn · 580 days ago · 107 comments on HN

Article summary

The author completed the Advent of Code 2024 challenge using only SQL, finding it to be a unique and interesting experience. While SQL was surprisingly pleasant to use in many cases, it was also painful at times, particularly with input parsing and recursive queries. The author notes that SQL would be more efficient and pleasant to use with mechanisms to update state. The experiment showed that complex algorithms can be coded in SQL, but it also highlighted limitations in recursive SQL.

Main themes

  • SQL programming
  • Advent of Code
  • Recursive queries
  • Database architecture
  • Programming challenges

What commenters say

  • Using SQL for complex logic is not a good practice due to maintainability and readability concerns.
  • SQL can be a powerful and efficient tool for solving complex problems, but it requires a different mindset and skillset.
  • The use of recursive queries in SQL can be limited by the lack of support for updating state and excessive memory consumption.
  • Some developers believe that database management systems should be used only for managing data, not for implementing complex logic.
  • Others argue that SQL can be a viable option for complex logic, but it requires careful consideration of the trade-offs and limitations.
  • The choice between using SQL or other programming languages for complex tasks depends on the specific requirements and constraints of the project.
  • Some commenters appreciate the density and logic-oriented nature of SQL, while others find it tedious and difficult to work with.