khaines / enigo.com wrote:
> Some time in the past, I wrote a line of code.
> 
> It looked like this:
> 
> if pu : pu = pu.url.to_s != '' ? pu : nil end

I wasn't even aware that you can use ":" instead of "then"...

Is this equivalent to your code?

pu = nil if pu && pu.url.to_s == ''

I find it still pretty concise and much easier to read.

> Sure, it's concise, but what did I gain by making it so concise over 
> making it so that it was clearly readable a year and a half later?
> 
> Not much.

Was there any gain at all?

> Sometimes clever is good, when there is a reason for it.  However, that 
> time, clever was just plain stupid.

Right.

Kind regards

	robert