Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Simply referring to it as the 'sizeof operator' would be preferable. Otherwise ignoring the ability to drop the parentheses seems fine though.

That way the author presents a simple, useful conceptual model and hints that it's actually a little more complicated than they described. Seems like a good trade-off, as there's lots of stuff to learn, and sizeof's hidden weirdness is unlikely to bite any students. When writing code, there's basically no drawbacks to just following the simpler rule of always using parentheses and it makes expressions a little easier to follow [1].

[1]: https://lkml.org/lkml/2012/7/11/103



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: