From: Austin Ziegler Date: 2006-09-12T21:08:44+09:00 Subject: Re: Joel Spolsky on languages for web programming On 9/12/06, Rob Sanheim wrote: > On 9/11/06, Austin Ziegler wrote: > > It's an Opinion. A potentially valid one, but just an Opinion. > > Frankly, DHH has made a number of mistakes in his Opinions on what a > > database should do. Some of these are worse than others -- encoding > > MySQL semantics into AR behaviour (when MySQL is *not* doing the right > > thing by any measure) is a good one. > [snip] > Could you elaborate on this? I'm curious as to what you mean by > "mysql semantics into AR behaviour". Do you mean the preference to > treat a database as a glorified hash, and not enforcing any > constraints at the db level? That's one. An aversion to foreign keys (which, contrary to DHH's assertion, *can* encode the relationships captured by most of the belongs_to_* sort of helpers in AR) is another. The one that's always annoyed me most is the fact that MySQL behaves incorrectly with respect to table and column-name case-sensitivity. That is, these two are supposed to be identical: SELECT ID FROM PRODUCT; SELECT id FROM product; SELECT Id FROM Product; You're only supposed to be case sensitive if you enclose your named object in double quotes: SELECT "Id" FROM "Product"; Oracle, for example, when you query the data dictionary, returns columns in all caps. This means that the folks who wrote the Oracle adapter for AR have to go to the extra effort of downcasing everything ... unless it's mixed caps. This is one point where (IMO) the SQL standard made big mistakes (allowing any case-sensitive object names at all, no matter the reason), but AR encodes MySQL behaviour as if it were correct. (Worse, MySQL behaviour is not consistent on this matter; on Windows, MySQL itself is case-insensitive but AR is still case-sensitive. MySQL is one of the worst damned implementations of SQL ever. Still.) -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca