Hacker News new | ask | show | jobs
by necovek 500 days ago
> ...abuse of @decorators in Python, which are side-effect pits of hell.

And just as I posted this, an articles shows up on the front page (https://www.dbos.dev/blog/what-is-lightweight-durable-execut...) claiming this:

> So how does this work? The key is in those decorators, DBOS.workflow() and DBOS.step(). They wrap your functions with the code that durably executes them. At a high level, they persist your program’s execution state–which workflows are currently executing and which steps they’ve completed–in a Postgres database.

Ouch! Those innocent looking lines of @DBOS.workflow or @DBOS.step make decorated functions actually connect to a Postgres database somewhere, and you can't be certain if you can test those functions without Postgres anymore. Ouch, ouch, ouch!

So, developers, please, remember the implicit vs explicit rule of thumb.