Things I haven't figured out (2024 February)
2024-02-05
I would like to messily reflect on some tech questions for which I do not have answers.
Databases and migrations
How are you supposed to manage database migrations? Web frameworks tend to have their own migration tools, but microframeworks tend not to. When I use Django, it's clear that the model file is the source of all truth; everything else is derived from the models in some way. The database is thus subordinate to your Django app. Should it be the same for microframework apps?
What would it be like to write an app that is subordinate to the database? How would you manage a database that is superior to your app; should such management be done through bespoke SQL scripts? Comments on Hacker News love to debate the merits of using an ORM versus raw SQL. Is this the assumed knowledge that I lack -- that raw SQL is best used when the app is subordinate to the database? How hard would refactoring such an app be if the model of its database changes, and is there a way to manage it?
I realize now that I never had to migrate Receipt Scanner (a FastAPI and thus microframework app), which is why I didn't have this problem. All the changes to the data model were made in development. Once it was in production, its data model remained static.
Niche languages and libraries
Some developers really seem to love niche languages like Elixir and Clojure. I've always been interested in learning them, but I am almost always stopped by what I perceive to be a lack of libraries, which is of course a proxy for a lack of community infrastructure in general. Why do these developers seem to insist that this isn't a problem?
I come from Python (and to a lesser degree JavaScript), where the ethos is not to do things yourself if you don't have to. In other words, reach for the library that doubtless exists. Is the ethos in these niche languages to build things yourself, to do things yourself?
Speaking of doing things yourself: some things, like adding an HTTP header to a response, is easy. Calling the AWS API without an SDK is less easy. Elixir doesn't have an official AWS SDK right now. Do the users of Elixir and I just have different definitions of easy? Do they just not use AWS? What am I missing here?
I read an article on the "curse of lisp". Its thesis is that powerful languages like Lisps make it easy to do things yourself. There is thus no pressure to build infrastructure since it is not needed. If everyone can fly, no one will build roads. Is that where the love of these languages comes from, the sheer power inherent in the language? Can everyone using these languages fly? How can I learn to fly?
Clojure can interop with Java. Is that why there don't seem (remember, I come from Python) to be that many Clojure libraries, because you can just reach for a Java library? The Java community has already built the airplanes. Clojurians can both fly and ride Java Airlines. At least that solves the AWS SDK problem.
I saw a StackOverflow thread about Vim that suggested a similar philosophy to the Curse of Lisp. The question-asker asks for a plugin for auto-closing parens and gets an answer that advises simply adding some code to their configuration file. I suppose Vim lets you fly, too.