Skip to content

Comment on Abstraction boundaries are optimization boundariesparent

Comments

You just defined ORMs and made no comment on consistency. And Linq is what prompted me to write the comment.

In this EF code, we're deducting an amount from some balance, not necessarily the highest balance:

  // Find the highest balance
  var maxAccount = await db.MyAccounts.OrderByDescending(x => x.Balance).FirstAsync();
  ...
  // Deduct an amount
  maxAccount.Balance -= amount;
Whereas in SQL, it will work.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.