Correct Arity

It took some extra work to build, but now we'll be able to use it for all our future projects - how to ensure your code is never reused. Let's not overthink it; if the code is still in use that far in the future, we'll have far bigger problems - how to ensure your code lives forever.
By Randall Munroe, CC BY-NC 2.5 , Link

CRUD apps are cool and important

Projects that do some concrete thing — solve a real problem in the world — are very cool! Good software, including reusable software, comes from them.

I sometimes see purely technical projects (eg distributed KV store) on Reddit, Discord, etc. that (imo) go the wrong direction: they begin with some supposedly reusable library that lacks even one real use, rather than go problem -> CRUD app -> reusable library. Imo they assume "CRUD" (create, read, update, delete) apps are formulaic and uninteresting, but really any application that does something useful in the world will have interesting business logic at the very least. Also useful projects often need reusable technical bits which you can pull out into a library or framework.

For example, Django came out of a local newspaper's website, similarly Rails came out of a project management website. They didn't first sit down and pull "a web framework for perfectionists with deadlines" out of the ether and say ah it should have an ORM and routes and admin page and so on; they wanted a Python content management system for a newspaper, and realized they could open source these technical bits to reuse them elsewhere. And it turned out lots of people wanted to make a web app with a database quickly in Python. That need for CRUD apps over the years drove work on Django.

This is a bit squishy to quantify but a good metric would be the ratio of complexity in the reusable code vs number of solutions to real problems in the world. For example there is a lot of junk in Lustre, but it's also used a fair amount. I mean some types of things like UTF-8 can be both simple and used a ton, which is beautiful, but ok a library for websites has to have a fair amount of junk in it, fine. So again this is kind of squishy, it's not like you can just calculate quality = number of uses / lines of code. But it's good to ask "for the sort of thing this is, does it have good examples to justify the complexity?" And it's not like it necessarily needs a huge number of examples; a few high quality examples also suffice, ie examples where the library solves a lot of problems nicely in the world.

So for instance (not saying my project is particularly high quality, but), I used Lustre, SQLite, and Cloudflare R2 for correctarity.com/spark-joy. It lets you search Gleam packages by name/code/type/fn, and runs entirely in your browser which is bad in that it makes you initially load 150MB but good in that it's totally free and easy for me to host. It's important to me that it's as painless as host as possible, so I like that the database is just a static file and the work happens in browser. So it's cool SQLite can do that. Cloudflare R2 is whatever, I'm not not an expert and I'm sure there are plenty of alternatives, Cloudflare just seems like it has a nice free tier and easy UI. Most importantly, Lustre "clicks" for me for stateful websites much more than other ways I've tried. It's not like this is an objective claim that MVU is objectively the greatest or anything; just for me it makes sense: you type in input, that triggers SQL query, query comes back and puts results in model, and search results are always shown in HTML as a function of the model.

(Again not saying my project is particularly good, and for SQLite in particular my silly little page made 2 weeks ago is a drop in the bucket when they can estimate one trillion SQLite databases...)

On Lustre specifically, the docs have some basic examples but I would be interested in a list of projects eg surtoget.no that use it.

Applications aren't just good as evidence that the reusable pieces are good; making applications is how you figure out which reusable pieces are good and useful. For example on the BEAM There, Done That podcast Giacomo wants to first make fun Gleam AtomVM projects, and only after that see which parts would be good to extract out. Without having done applications, trying to write an API would mean shoving everything in or guessing what's needed, whereas after having gotten applications to work a good API design will hopefully follow naturally.

This is not to say researching new things is bad; rather, good taste in software research comes from dealing with problems in the real world. Stonebraker's "10 fears about the future of the DBMS field" include customers no longer attending DBMS conferences — "A very dangerous state of affairs, indeed!!!!". For programming languages, libraries, etc., new things can be cool to try, but taste/motivation comes from the frustation that existing tools don't fit your problems as well as they could, and the proof in the pudding that new tools are good is applications using them. I feel like I say "in the world" every paragraph but yeah, solving a real problem forces idk, a minimum level of usefulness and intolerance of needless complexity.

Also not all apps do all of create/read/update/delete exactly, often there will be a database but that's not the main thing...I realize I talk a lot here about why applications come first and then libraries and don't say anything about how business logic is itself interesting...I guess the incentives to open source business logic are not there whereas it's a much better deal to open source generic reusable bits, but that's a separate conversation.