Question: I was having a discussion with some programmer friends who said that they see Ruby programmers (in particular) producing a lot of code that's "too clever". So I'm wondering what would that look like? I'm referring to the unnecessary use of an obscure language feature in a context in which something straightforward would have worked just as well or better. Know any good Ruby examples of this?

Answer: 
method\_missing can be abused and it's one of those things that may cause you to pull your hair out when you have to fix a bug 3 months after you've written code.
compare:

```
if MODELS.keys.inject(true) {|b, klass| b and klass.constantize.columns.map(&:name).include? association.options [:foreign_key]} then 
  # ... 
end

```

1 line (if), 132 chars, 132 avg len, 22.9 ﬂog

vs

```
fk = association.options[:foreign_key] 
columns = MODELS.keys.map { |key| key.constantize.columns.map { |c| c.name } } 
if columns.all? {|column| column.include? fk} then 
  # ... 
end

```

4 lines, 172 chars, 43 avg chars, 15.9 ﬂog

much faster too.

Original author actually argued maintainability for the first version.