- being disappointed in the integration potential of existing rails cmss #
- want to work at cross-purposes? ask me how! #
Powered by Twitter Tools.
Powered by Twitter Tools.
Think about the following statement: my younger brother is male. On the surface, that’s tautological - all brothers are male. In fact, however, it’s false, since I don’t have a younger brother. The proper logical interpretation of the sentence is: there exists some X such that X is my younger brother and X is male (’X is my younger brother’ could, of course, be further unpacked). Since there is no X that is my younger brother, the statement as a whole is false.
Now think about this statement: Sherlock Holmes is male. Given the above analysis, we should conclude that this statement, too, is false, since there is no X that is Sherlock Holmes. Intuitively, however, this seems wrong. We want to say that Sherlock Holmes is male is actually true - for some reason, it feels like we can reset the metaphysical scope of our statements when we’re talking about fiction so that there is, in fact, a Sherlock Holmes that we can make true and false statements about. Sherlock Holmes’s non-existence is a different type of non-existence than my younger brother’s.
No conclusions here - just something for people to think about.
Powered by Twitter Tools.
This has been a conceptually difficult post to write, because unlike the other virtues we’ve explored, Cleverness is a bit … dangerous. Before we get started, then, a warning: don’t even attempt to be clever in your code unless it’s already correct, simple, comprehensible, and testable (or tested!)
So, cleverness. I think of clever code as that which, while it may not be transparent at first glance, produces that ‘A-ha!’ flash of insight as you look at it. Clever code teaches you something, and you’re a better developer for having learned it. Blocks and procs in Ruby are clever - newbies often don’t grasp how powerful they are, but once they figure it out, the sky’s the limit.
Cleverness is, of course, observer-dependent (what’s clever to _why may be incomprehensible to me), and as a result your code can be too clever, when it flies over the heads of the people who have to read and use it. This, then, is the double-edged virtue, and is easily the most difficult to intentionally obtain.
The good news, however, is that you generally don’t (or shouldn’t, at least) try to write clever code - unlike the other virtues (and like beauty, I’d argue), cleverness is something that just happens every now and then in your code. When you struggle over some part of your code, only to replace it after suddenly realizing a simple solution was hiding behind the problem the whole time - that’s when you get clever code. Trying to be clever, however, generally just pushes you into the too-clever range, and your code is the worse for it.
Powered by Twitter Tools.