A r t i c l e s
ActiveRecord a Toy For Children
See also: Object-Relational-Mapping-Is-Double-Dipping
Found some interesting evidence that Active Record really is a toy for kids.
"Complexity is best located in the code, not in the database, according to the Rails developers."
Laughing. I usually celebrate when I can let the database do work for me. It's like hiring somebody without having to pay them. When complexities can be outsourced into the database it is a good thing, not a bad thing.
It's funny how ruby people (kids?) are hot to advocate things like MVC (model view controller) and HTML templates... but when it comes to database work they just hard code all the database stuff into their objects as if the objects and database are one big pile of poop. Since they love cool acronyms like MVC maybe we should start a new trend and acronym called:
Let The Database Do Some Work You Stupid Idiots
...which would hopefully catch on just like the hyped MVC acronym they propagate.
"Avoid SQL injection with find. Use an array or let it do the quoting for you. By itself, it allows you to do stupid things - so avoid cross site scripting, etc."
Obviously these 'rails' children haven't heard of parameterized queries (a.k.a. server prepared statements, escaped sql templates).
No. Do you know what the word relational means? Have you ever used a database? Do you know what a database is? It is not a toy. Associations? What the hell happened to relations?
1. has_one - when the FK is in the OTHER table
2. belongs_to - when the FK is in THIS table
"ActiveRecord also allows for output formats - like to_yaml, to_xml, to_json. So your database records can become XML pretty easily."
A database cannot "become XML pretty easily". A database can be exported in a shitty format such as XML but please don't say that a database can "become XML".
"Rabble also gave us an anecdote from his Odeo days. They thought that grabbing feeds should be done in parallel. Which is when they used RubyThreads. And suddenly, they were getting some horrendous database problems, duplicate records and so on. Moral of the story: RubyThreads and ActiveRecord donít mix. A member of the audience mentioned that using find_by_sql consumed about 1MB of memory in his application, however, using ActiveRecord to do the same thing was costing about 20MB per thread."
Why am I not laughing at this? Because it is so dumb that it isn't even funny.
Note: This Wiki is outdated, personal views may have changed.
This wiki contains info on life, health, humans, nature, programming, database, fads, paradigms, poems, principles, theories.
Articles may contain statements which some may find helpful and encouraging, or even discouraging.
Beware, I believe in the Grand Justice system.