Using raw Express + Prisma is messy once code becomes meaningful.
For example, implementing defaults code for models, so a new record can be initialized with JS code. It can be done with Prisma, but it is not pretty, and not discoverable by someone else reading the code.
It got me looking at other frameworks like AdonisJS and SailJS.
Working on some pure node code for a change. I am really missing Rails. I want someone else have made all of the hard choices about directory structure and conventions for me.
AdonisJS looks like it might provide what I am missing. https://t.co/2a6QimkHAe
@mitchellh Don't be angry at Github. Be angry at all of the automated code that is thrashing Github and making it worse for us humans. https://t.co/kGuMXcKmBq
It turns out we are not the only people to see crazy growth over the last few months. Github is seeing it too [1].
Not having usage caps (unlimited repos, unlimited commits, unlimited PRs) no longer works when those things are all being done by agents at scale, rather than by humans.
[1] https://t.co/xGcqJVZXaw
Heroku was always the obvious choice for quick hosting. Then there was this announcement [1]. Whatever that means ... don't use us for new projects?
So I thought I would try https://t.co/sfoNFs6fyx. A lot of similarities with the CLI, but just not quite as polished: cryptic errors and a couple of calls that didn't work the first time.
[1] https://t.co/38FEUqTk94
Here is the email subject to use if you want me to read your random marketing email:
> you just gave your coworker the passwords
Mission accomplished. I was very confused reading the email since it was nothing to do with passwords.
Recently I came across https://t.co/Nv3b3FA76A which is really intriguing. It has the same advantages I described above, plus some more:
* It also encodes the record type into the ID. This is great for debugging, and allows simpler polymorphic relationships.
* It has 64-bits of randomness, significantly reducing the risk of collisions. It is enough to be able to treat IDs as unguessable ... but not quite enough to satisfy cryptographic level unguessability.
* It has a pretty and compact textual form when users see IDs, e.g. `user_2accvpp5guht4dts56je5a`
* A small, but meaningful benefit: double clicking a UPID in an editor selects the whole thing. Unlike UUIDs which use dashes and are not selected on double click 😡
Choosing the primary key type for a database is a choice with so many implications. The default choice: auto-incrementing sequence numbers is my least favorite approach. It makes it impossible to allocate sequence numbers in separate systems.
In my last big project I used a 64-bit integer divided up into 42-bits for a timestamp (~4ms resolution) and a 22-bit random number. This type of approach has some advantages:
* IDs can be allocated in a distributed way, independently of each other (e.g. in front-end code).
* IDs still provide creation ordering which can be useful for things like stable sorts and batch scripts. Though this order is not perfect because of the 4ms resolution. e.g. an UPDATE, DESTROY audit record could end up with IDs that make it appear like the DESTROY happened before the UPDATE.
* 64-bits are good for DB storage, and the creation-ordering makes efficient use of the index block cache.
* 64-bits are bad for Javascript. Treating record IDs as numbers in JS causes them to be truncated to 53 bits. So they need to be strings.
More in thread:
Normally I use Claude models through Google Vertex, but this morning I made the mistake of using https://t.co/e4ZgDbhVE0 ... now Claude is down and I can't even get my chat history. Ouch.
If my brain contains a hundred trillion synaptic connections. And an 1T weight LLM can encode the whole Internet and every book ever written. Why can’t I remember more stuff?