3 ms·
Sounds really clever, but also has the potential to be really opaque and confusing. On the other hand, the trick in the article is quite verbose. Can be tricky
by beefsack 8y ago
Sounds really clever, but also has the potential to be really opaque and confusing. On the other hand, the trick in the article is quite verbose.
Can be tricky balancing terseness with readability.
- Sharlin 8y agoI would say that this switch hack is lightyears more "clever" (that is, opaque and confusing) than a simple function pointer.
- usefulcat 8y ago> has the potential to be really opaque and confusing Yes, but.. compared to switch and preprocessor hacks described in the article? Granted it's subjective but I'd find a function pointer that's assigned to once to be way easier to comprehend.
- carlmr 8y agoYeah, I think both methods are somewhat opaque, and the one described here is opaque + hacky. I wouldn't let this through code review.