Declarative, Imperative, and all that

For the last few years, concepts from Functional Programming have been trickling into the mainstream. Whereas earlier these alien ideas were met with shrugs and raised eyebrows, now it’s cool to be seen as one who writes monads or dishes out wisdom on paradigms and whatnot. I was quite happy, therefore, to see that the latest edition of the React newsletter by had an article on what it means for React to be declarative.

Understanding recursive queries in PostgreSQL

Perhaps 3-4 years ago in an interview, I was asked a query to print a product hierarchy or something in the context of an e-commerce site database. I couldn’t, of course, as I barely had a handle on basic aggregations at that time. To be fair, I still don’t know whether there’s a non-brain-twisting query that’d print the entire hierarchy of a tree-like system. However, I do know now have to do a subset of it – i.

Understanding window functions in PostgreSQL (Part 2 - DENSE_RANK())

We continue our study (and enjoyment!) of PostgreSQL window functions from last time. And in case you didn’t read that one or don’t wish to, here’s a quick motivation for using window functions: they help us write “difficult” queries that would otherwise be inconceivable in basic SQL features! Find the third-most costly product in a particular category I don’t know about you, but a requirement like the above makes my heart freeze.

Understanding window functions in PostgreSQL (Part 1)

As fullstack developers, we rarely pay attention to the intricacies of databases (or relational databases, to be more precise). It’s understandable why it’s so, because we’re crushed by the complexities of the apps we are building, and the pressures of meeting deadlines and whatnot, and there’s hardly ever time to look in this direction. However, I believe we should make an effort to improve our knowledge of the tools we use, no matter how “useless” that knowledge may seem at the time.

Poor Documentation = Poor Culture?

“You mean the docs must be changed?! Why? For your ego??” was the response I received on the Larachat Slack forums (of the famous Laravel PHP framework) one day. The gentleman was a veteran on the forums, and the argument I had wasn’t even a bad one. The exact details escape me, but my point was that I couldn’t figure out how to pass route params in the case of reverse routing.