3 ms·
I don't think his example is great. Here is the equivalent in Django (in Python, a language that exposes 'explicit is better than implicit' as a core ideology):
by orf 10y ago
I don't think his example is great. Here is the equivalent in Django (in Python, a language that exposes 'explicit is better than implicit' as a core ideology):
class Person(models.Model):
company = models.ForeignKey('company', related_name='people')
How is this worse than the implicit version on the post? Basing it purely on a LOC argument is flawed as implicit doesn't always mean less code, and explicit doesn't always mean more code. In this example there is actually less code, you don't need a `has_many` at all (unless it's a m2m, then it's the same LOC).
- majewsky 10y agoIn my experience the Ruby community is all about LOC arguments. So many blog articles I read about Ruby stuff is just "look what I can do in one line", and I'm like "maybe you shouldn't?". For example: https://twitter.com/stefanmajewsky/status/643380134037323776 https://twitter.com/stefanmajewsky/status/643380134037323776