mcmire
Joined 15 years ago
Joined 15 years ago
[1]: http://simbad.u-strasbg.fr/simbad/sim-basic?Ident=sirius&sub...
Anyway, obviously there were a couple of mistakes by the speech recognition, and they were taking care to speak very clearly, but still, I'm impressed. The future looks bright.
This is fine if all you want to do is unit test your classes. That's beside the point though -- I would posit if you're bolting dependency injection onto your interfaces just to make your tests faster, you're not doing it right. Instead, bring that dependency injection into the forefront: to the constructor. Yes, this means to make an object, you'll have to make another object first, both in your production and test code. But now your interface acts the same way in both places. If this sounds very Java-like, well... maybe Java got it right. (There was an article on the Twitter blog in the early days about this but I can't remember where it is now...)
Of course, this is going to introduce complexity and now you have to decide whether that complexity is worth it.
Here's the thing: I already know how many models I have (I just look in app/models) and which columns back them (I just look in db/schema).
The thing I often want that 1) ActiveRecord doesn't give me and 2) I haven't seen in any tool yet is a diagram of the relationships. So I have two models, A and B, and A has many B. How do you diagram that? Typically I've seen arrows: B points to A, with the words "has many" written next to it. The thing is, if I have 30 models in my app, I'm not going to be able to read this at a glance. Words are too small. Diagrams are meant to be rough pictures.
The way I visualize this in my head and consequently diagram this on a whiteboard is, multiple instances of B point back to A. It's easy. If you have a has_one instead, then only one B points back to A. Makes sense right? No one does this. I often wonder why.
The usefulness of Facebook is a big deal though. And it's just not useful anymore. My friend group tends to be pretty selective, and is mostly made up of people I know and interact with in real life. So I do that instead.