Hacker News new | ask | show | jobs
by irahul 4960 days ago
>> K&R than GoF.

> Very different comparison to the patterns Fowler presented.

You are intentionally trying to miss the point. I don't have to explain how K&R and GoF are very different books, and how Fowler and GoF are very similar books.

> people who in many cases have not even heard about the other ORM patterns presented by Fowler, much less other alternatives.

You mention Folwer 10 times in a row as if he is the appointed expert on ORM. Call me when he has written one, and it's better than the existing ones. Yes, AR is based on AR pattern named by him. So what? Talks are cheap. Produce a better ORM if you are so sure about the deficiencies and Fowler already told you a better solution.

> even then, the "Rails way" of doing your example would be Person.find_by_lastname(lastname)

find throws and exception and where does not. Whoever told you the rails way is to not use where and use the dynamic finder is full of it.

> The biggest problem in your example as why you are asking for persons with specific last names in the first place.

Do I have to tell you that's an example? Really?

> Also, what happens when you need to serve that query from a web API instead of your database? From a full text engine? From file? From a noSQL database? From on disk hash table? I've had to do all of these - often several from the same application. With a suitable architecture you just plug in your new storage and implement the finders you need supported, and won't have to play "hunt the raw SQL". Changing column names is the least of my concerns - that can be fixed with a simple search replace.

Querying needs a language. SQL is for relational databases. A data source agnostic query language does not exist. You can't abstract something that doesn't exist in the first place.

<quote> > github, twitter, heroku et al would like to disagree. And Ebay at least used to be written using ISAPI modules, and large parts of Yahoo runs or used to run on a horrific mess of PHP and Perl (I used to work at Yahoo; there was a lot of dreadful code). Your point again? (and Twitter is a particularly bad example given how much time they spend moaning about how they've needed to move most stuff off Ruby) </quote>

You said AR is a pain for big projects. I pointed out big projects which use AR. And then you are selectively copy pasting to paint the wrong picture.

Twitter moans about Ruby's performance, not project size. Either get your facts straight or stop intentionally twisting them.

> Strawman. If you think simple cases like that is what it is about, you've not seen much complicated Rails code, and it's a waste having this discussion with you.

I have not seen big projects. Twitter and Github aren't worth mentioning. Apparently I missed the memo where you were appointed the authority on big projects.

I have wasted enough time with you. Apart from mentioning Fowler about 50 times, and whining about how Person.where("last_name = ?", last_name) will be an issue when we find life on Mars and we need to integrate with their data sources, there is absolutely nothing you have to say about AR.

You win. You can go home now.