3 ms·
> A problem that may ORMs have is thinking/working with row-expressions rather than sets. Absolutely. There's a reason that the famous Out Of The Tar Pit[1] pa
by feoren 4y ago
> A problem that may ORMs have is thinking/working with row-expressions rather than sets.
Absolutely. There's a reason that the famous Out Of The Tar Pit[1] paper identifies relational algebra as the solution to many programming woes. Thinking in sets instead of individual items is extremely powerful, when using an ORM and also in general. If an ORM makes this hard, use a different one (hopefully there is a better option).
> Related pet peeve: calling tables by plural names
Agreed again! Based on my limited observations, this seems like a big cultural difference between "database people" and "software people". The people who spend most of their time working directly in databases (and trying to basically write fully fledged business applications entirely in the database layer) seem to think of tables as big containers. If you labeled a box full of people (or a binder full of women?), you'd probably label it "People". Whereas "software people" tend to think of a database table as a definition of something, more like a class or type. Clearly the correct label for that definition is "Person".
Actually the latter is also wrong for a different reason: that is not how nouns work. But that's a story too long to fit in this comment.
[1] Out of the tar pit (warning: direct link to 66-page PDF): https://curtclifton.net/papers/MoseleyMarks06a.pdf https://curtclifton.net/papers/MoseleyMarks06a.pdf
- int_19h 4y agoIt's the other way around - "software people" tend to use plurals for table names, because it then maps nicely to plurals in property names in their object layer, where it's already the established convention. The "database people" OTOH tend to use singular, which goes at least as far back as C.J. Date. I'm not sure why, but perhaps it's because fully qualified field names read more natural.
- somat 4y agoit is either a bunch of apples in which case you would call it apples, or it is the box that holds apples, in which case you would call it apple. as in apple_box. Got to admit I am pretty firmly in "it is the box that holds apples" camp so none of my array, table, dictionary names are plural. Some time I comfort myself by saying "well, apple[5] just sounds better" but that is really up for debate.
- fijiaarone 4y agoActually, all the old relational texts talk about select * from employees (plural) because they didn’t have aliases for table names in queries. I agree that when you use aliases for multiple tables when you use (Oracle, non-standard SQL joins) that it looks prettier, but you can also do that with plural table names. Select employee.name manager.name from employee, manager where employee.manager_id = manager.id But it doesn’t matter that much when you use the traditional join syntax: Select employees.name, managers.name from employees left outer join managers as manager on employees.manager_id = managers.id Still I prefer singular table names, just disagree that it was data people who preferred singular and why. Of course, with aliases you can return the exact name you want with aliases: Select e.name as employee, m.name as manager from employees e, managers m where e.manager_id = m.id