3 ms·
> The idea that one has to know all the hidden edges of a language switch is hardly a hidden edge, it's an important control structure in the language. You wan
by digler999 10y ago
> The idea that one has to know all the hidden edges of a language
switch is hardly a hidden edge, it's an important control structure in the language. You want a "hidden edge", look at designated initializers [1] which I just heard of yesterday (thanks to HN), despite having 17 years experience using C. Or bitfields, or function pointers.
[1] http://www.drdobbs.com/the-new-c-declarations-initializations/184401377 http://www.drdobbs.com/the-new-c-declarations-initialization...
- AnimalMuppet 10y agoSwitch is hardly a hidden edge, but using it like that is.
- minitech 10y agoDesignated initializers aren’t “hidden” at all, just new (and not that new).
- tomjakubowski 10y agoHuh, I wouldn't think of function pointers as a hidden edge in the language, and I've only been seriously using C for about 4 years. Is there some crazy consequence of using function pointers that I've been missing? Callbacks are pretty ubiquitous in C code bases, and the "hand coded vtable" pattern isn't too uncommon. Maybe the lesson is that what language feature are the "hidden edges" depend on one's domain.
- digler999 10y agoI was being figurative. nothing's hidden in an ANSI standardized language. My point was you can go along way in C without ever needing function ptrs. Their syntax isn't exactly welcoming, either. Compared to switch, which OP had compared to a hidden corner, need switch a lot more frequently than you need function pointers.