5 ms·
+-----------------------------------------------------------+ | | | C has support for dynamic typ
by huhtenberg 14y ago
+-----------------------------------------------------------+
| |
| C has support for dynamic typing (in the form of void*) |
| |
+-----------------------------------------------------------+
A quotable thinker.
- Xcelerate 14y agoHaha I can't stop cracking up! Although it reminds me of when I wrote a ray-tracer in high school. Every reflection distribution function took some kind of void* structure and did something unique with it.
- bengl3rt 14y agoFunny, mine was the exact same.
- chrisohara 14y agoWhy are people so scared of void*? Are there any VM's that don't resort to some form of pointer tagging when implementing dynamic typing?
- pmelendez 14y agoI don't think people is scared of void*. However, it is pretty easy to introduce memory corruption bugs when it is used in big projects. I find very wise to avoid it when it is not necessary or when there is an equivalent safer alternative (e.g C++ templates if available and applicable). In this case however, is not only completely fine but I don't think there is a better way to do it. BTW, my favourite phrase of the article: "“… Why do this?” Because I can, of course." The truly spirit of a hacker :)
- huhtenberg 14y agoWho are these "people" exactly?
- praptak 14y agoOk, so instead of "method not implemented" you get memory corruption. Big deal.