4 ms·
Ask HN: What programming project pushed you further?
I’ve been having a blast of a month with programming, trying to build a visual SQL query builder in React.
It’s worked my programming muscles quite some, more than typical business asks.
This is due to the fact that the main data structure holding the resulting SQL Query is a recursive data structure - so most of my functions for manipulating that structure are recursive. Recursion is fun is fun is fun is fun!
Furthermore, query fields can have an infinite amount of chained functions that act on the field, and order of operation matters - so for the first time in my career I’ve had to implement a singly linked list to house these functions.
And then to manage the state, there is a top level query state managed by a reducer and dispatch, and as you drill down into the query (individual rules, fields) they have their own reducers that have an enhanced dispatch method that kicks actions up the chain to the top level query state.
Seriously I wish my job was always this fun. I highly recommend to intermediate devs to try build a query builder.