79469379

Date: 2025-02-26 10:38:51
Score: 0.5
Natty:
Report link

Asking a question why a library returns some type and not other usually have only one good answer - because the author(s) chose so.

Imagine you have to implement a database abstraction layer that is supposed to be able to communicate with different databases (postgres, mssql, oracle, mongo, cosmos etc.). Abstract classes is very elegant in giving you consistent API no matter the underlying database, think of it as an interface that also can store its own state and share implementation for common things.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: roten