C is beautiful yet full of horrors. Here's to uncovering its hidden depths.
As silly as it is nowadays, switch just being a glorified goto was used seriously for manual loop unrolling. Let me introduce Duff's Device: https://en.wikipedia.org/wiki/Duff%27s_device
Nice. Now I'm curious what other creative (ab)uses of C the machines will find once they got trained properly.
"… without making it unreadable."
Hah, that's what you think! 😅
This is a hilarious technique that implements coroutines using similar switch tricks. https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
Amazing! I've been using C since 1989 or so and just learned stuff that I wish I never knew :-)
Jumping into an expression is truly cursed, gonna steal that to scare my friends.
This was amazing.
It highlights the simplicity of C and also shows what a monster it can be if we let developers run loose with it.
No wonder large projects like the kernel have coding standards to ensure code comprehensibility.
As silly as it is nowadays, switch just being a glorified goto was used seriously for manual loop unrolling. Let me introduce Duff's Device: https://en.wikipedia.org/wiki/Duff%27s_device
Nice. Now I'm curious what other creative (ab)uses of C the machines will find once they got trained properly.
"… without making it unreadable."
Hah, that's what you think! 😅
This is a hilarious technique that implements coroutines using similar switch tricks. https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
Amazing! I've been using C since 1989 or so and just learned stuff that I wish I never knew :-)
Jumping into an expression is truly cursed, gonna steal that to scare my friends.
This was amazing.
It highlights the simplicity of C and also shows what a monster it can be if we let developers run loose with it.
No wonder large projects like the kernel have coding standards to ensure code comprehensibility.