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.
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-)
Re: Duff's Device
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
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