Pages

Thursday, August 27, 2009

Being punctual, or responsible?

Someone post about this in slashdot.org.

The issue is about leaving/creating 'dirty coding' just to fulfill deadline. Basically this is about programming ethics.

More at http://www.gamasutra.com/view/feature/4111/dirty_coding_tricks.php


Hmm... what do you think?

Tuesday, July 07, 2009

Duff's Device

It looks like an invalid code, but it is valid! This code portion is known as Duff's device.
    switch (count % 8) {
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while ((count -= 8) > 0);
}
More http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html