[-] tatterdemalion@programming.dev 15 points 1 month ago

This is entering the rotation.

[-] tatterdemalion@programming.dev 15 points 2 months ago

Yea if you don't explicitly give it direction on how to keep the code maintainable, it will gladly just spew shit into the same file until you have 10K LOC in it.

[-] tatterdemalion@programming.dev 15 points 5 months ago

Don't use any company's storage as your only copy, or even as your main means of access. Self host as much as possible.

[-] tatterdemalion@programming.dev 15 points 11 months ago* (last edited 11 months ago)

There is a subtle scenario with read-modify-write transactions in MVCC where SQLite lacks some grace (in my opinion).

In MVCC, transactions work with a point-in-time (read "between atomic transactions") consistent "read snapshot" of the database.

Consider this example:

  1. Transaction A begins and reads from table foo.
  2. Transaction B begins and updates table foo.
  3. Both transactions commit.

There is no conflict here because these transactions are isolated from each other via the snapshot mechanism. Transaction A's read snapshot is immutable and will not see any writes from transaction B, even if they are happening concurrently.

Now what happens in this example (from the OP):

  1. Transaction A begins and reads from table foo.
  2. Transaction B begins and updates table foo.
  3. Transaction B commits.
  4. Transaction A tries to update foo.

This is a true conflict because both transactions are trying to write to foo, and transaction A's writes might be based on what it just read. There is no consistent way for A to proceed, because B already wrote to foo, invalidating A's read snapshot.

So SQLite handles this by returning an error to A, effectively requiring A to restart the transaction.

There are other ways this could be handled though. The DB could optimistically retry the transaction for you. There is even a special BEGIN IMMEDIATE; statement that it could use to proactively take a write lock on foo so that the transaction doesn't get starved by other writers. But SQLite puts all of the responsibility on users to handle this.

I'm not an expert, so there could be a very good reason that SQLite works this way, but it feels a bit annoying as a user.

I don't actually know off the top of my head how PostgresQL handles this particular scenario.

[-] tatterdemalion@programming.dev 16 points 1 year ago

It's crazy that I've been on Lemmy for like 2 years and I think I've encountered direct toxic behavior only a handful of times. Obviously I'm aware of the trolls and problematic instances, but those can easily be blocked.

Am I the asshole?

[-] tatterdemalion@programming.dev 16 points 1 year ago* (last edited 1 year ago)

They call it: funflation.

No. You made that up and now you're calling it that. I hate these basic-ass brainwashing media outlets so much.

Is Good Morning America just ads disguised as news?

[-] tatterdemalion@programming.dev 16 points 2 years ago

Honestly who fucking cares if DOGE is actually efficient. Elon is an appointed executive branch official who hasn't been confirmed by the senate. He is wielding power unconstitutionally and needs to be removed immediately.

[-] tatterdemalion@programming.dev 16 points 2 years ago

TIL a doll is not a toy in the eyes of the law.

[-] tatterdemalion@programming.dev 15 points 2 years ago* (last edited 2 years ago)

My point wasn't so much that I think RED is shady but that exposing my IP seems like an unnecessary requirement to join. Why can I not have my membership tracked via an anonymous account? If they are concerned about account harvesting or something, then the interview already seems like a good enough measure, accompanied by seed ratio minimums.

[-] tatterdemalion@programming.dev 16 points 2 years ago

I think the skin color and hair style do more for his look TBH

[-] tatterdemalion@programming.dev 15 points 2 years ago* (last edited 2 years ago)

I can't speak for OCaml, but type inference provides a lot of benefit in Rust. I already have too many keystrokes as it is, and forcing me to be explicit about everything would just add to the stress of using a keyboard.

I agree that types should be explicit at API boundaries. That's precisely where you want to catch misuse.

As for the point about inference making code harder to read: I suppose that's true if you spend a lot of time reading code outside of your editor where you also must know what the types are. But that just sounds like a bad workflow in general. Why are you avoiding using a better tool for the job? Modern code review tools like Github even support LSP-like features to solve this problem; and if your language isn't supported... just pull the feature branch to review it.

[-] tatterdemalion@programming.dev 16 points 2 years ago

Yea this looks productive.

Imagine how useless the LSP suggestions are.

view more: ‹ prev next ›

tatterdemalion

0 post score
0 comment score
joined 3 years ago