geekchick: (evil computers)
geekchick ([personal profile] geekchick) wrote2007-07-20 01:20 am
Entry tags:

Duff's Device

[identity profile] adriang.livejournal.com 2007-07-20 12:54 pm (UTC)(link)
Speaking of coding practices..
    http://www.lysator.liu.se/c/duffs-device.html (http://www.lysator.liu.se/c/duffs-device.html)

Enjoy

Adrian

Re: Duff's Device

[identity profile] madbodger.livejournal.com 2007-07-21 04:20 pm (UTC)(link)
When I first read about Duff's Device, I had the immediate knee-jerk "NO! That is Bad and Wrong!"
reaction. Then I read it while thinking of the original K&R language design and realized that it
was a completely valid approach. The committe agrees with this.

Re: Duff's Device

[identity profile] adriang.livejournal.com 2007-07-24 12:15 am (UTC)(link)
Tom Duff, himself, showed an example of the device and wrote:
    Disgusting, no?

I think he also appreciates the same quality in it that you do. And yet, he makes a good case for using it, when appropriate. That's what makes this sort of gem so... delightful. 8-)

Adrian

[identity profile] krow.livejournal.com 2007-07-20 07:46 pm (UTC)(link)
I use them as I see fit :)

[identity profile] madbodger.livejournal.com 2007-07-21 04:19 pm (UTC)(link)
A few iterations back, the consensus turned out to be that gotos were not
the problem, LABELs were the bad thing. Then again, us Intercal programmers
trump it utterly with the "come from" instruction, which totally hampers
understanding!