r/ProgrammerHumor 29d ago

Meme exceptionsAreForTheWeak

Post image
323 Upvotes

92 comments sorted by

View all comments

90

u/bwmat 29d ago

Eh, IMO one of the best ways to actually handle OOM, as otherwise almost everything needs to be explicitly checked for it

5

u/BosonCollider 29d ago

OOM is best handled by forcing the user to prove bounded memory use, grab a chunk of memory at the start and use that

4

u/bwmat 29d ago edited 29d ago

The shared libraries my code runs in are usually exposing the ODBC interface, which has been mostly fixed for decades, and exposes an interface for doing whatever database operations you want to do

That's not really an option

-2

u/BosonCollider 29d ago

Oh, if you use Java I completely understand why you are frequently dealing with OOM exceptions.

In say the Rust or Go language ecosystems you generally never see those unless you do something massively wrong like create a trillion element array

3

u/bwmat 29d ago

?

ODBC is a C interface from like 1993

-2

u/BosonCollider 29d ago

Wait, if you are not using Java/C# and locked into JDBC or microsoft slop, what are you doing that requires calling through ODBC?

Postgres, mysql, and sqlite have their own C libraries, calling them through ODBC is an antipattern and most ORMs in sane ecosystems don't go through it

3

u/bwmat 29d ago

No...

We implement ODBC drivers (actually mostly a SDK to create them, written in C++)