News for hackers. Stuff that matters.
Re:Cognitive loads in programming by pmarreck on Wednesday August 31, 2022 @10:43PM (#32671260)
Isn’t the venerable spreadsheet a popular and quite working example of a declarative functional environment?
Re:Cognitive loads in programming by chii on Wednesday August 31, 2022 @10:49PM (#32671299)
the OP should preface the abstraction bulletpoint with a caveat that the abstraction must be well formed and logical.

spreadsheets are a great abstraction on calculating values based on tabular data.

ORM is not such a great abstraction on top of SQL.

Re:Cognitive loads in programming by cestith on Thursday September 01, 2022 @09:26AM (#32675934)
> ORM is not such a great abstraction on top of SQL.

I agree wholeheartedly with that. I'm not sure that's the direction an ORM should be targeting the abstraction in the first place. It seems more productive to abstract the code away from the point of view of the database than to abstract the database away from the point of view of the code.

Re:Cognitive loads in programming by chii on Thursday September 01, 2022 @11:27PM (#32686243)
or ORM should be only abstracting the slightly different syntax of different database vendor's sql implementation, not the actual mapping of objects or fields to database values.

I think the database's query results should be exposed directly, so that the developer could control the DB properly and directly (such as get access to cursors, etc)

Re:Cognitive loads in programming by cestith on Tuesday September 06, 2022 @11:31AM (#32738508)
It wouldn't really be an ORM at that point, but there's definitely a point to be made that an ORM is the wrong level of abstraction altogether when dealing with data-heavy applications. I actually really hate seeing SQL embedded in a web application serving things to customers, spread out across a bunch of routes and sometimes different route servers accessing the same database. Having a data API service for your data, or one for each major kind of data (for a store let's say customers, products, orders, etc) that talks to the DB and another layer with the application logic that reads and writes through that layer works well for performance and maintenance. It puts your SQL and your grants in a more controlled realm. The user-facing application and the data API can more easily be maintained, especially if you need a new schema or to further shard your data.