HN user

thezorg

94 karma
Posts2
Comments3
View on HN

Poor [Cloud Tasks](https://cloud.google.com/tasks), they're the actual GCP message queue, but everyone forgets they exist and use Pub/Sub instead.

What's funny is Pub/Sub is a fundamentally different model from message queues: queues are normally tightly coupled, meaning you enqueue a message to be processed by a specific system. Pub/Sub on the other hand is fundamentally loosely coupled: the publisher doesn't care who (if anyone) gets the message.

(I've heard "orchestration" vs "choreography" to describe this dichotomy, but I can't say I'm a fan of the jargon.)

I recently learned about the `])` motion (and similarly, `]}`), and it's probably my absolute favorite.

I used to rely on e.g. `df)` to delete function parameters. The problem is that 1. it doesn't work when the function call spans multiple lines, and 2. it doesn't work if there's a nested function call.

With `d])`, Vim will delete until the next unmatched ')', regardless of which line it's on! And to think this motion is buried under "Various motions": https://vimhelp.org/motion.txt.html#%5D%29.

Edit: an example:

  // This will become my_func(foo);
  my_func(foo, MakeBar(), MakeBaz());
             ^

Speaking of B-trees, I find CouchDB's implementation really interesting: the backing file is append-only, meaning that modifying the tree implies appending the modified nodes at the end of the file (for example, if I change a leaf, than I rewrite it at the end of the file, and rewrite its parent so that it points to the leaf's new position, and so on until we reach the root node).

Sounds like a waste of space, but it solves a bunch of problems, like being crash-proof (since we never overwrite anything, it's always possible to just find the last root) and allowing reads concurrent with a write without any synchronizing necessary. Plus, it's actually optimized for SSD's due to its log-like structure!

CouchDB B-Trees : http://guide.couchdb.org/draft/btree.html Log structures in SSDs : http://lwn.net/Articles/353411/