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

It's not just about readability, it's about making a contract with the user. If you typedef a complex struct in your library you're telling your users to treat this type like it's a black-box and not look inside because the next version of the library might contain something different and your code will break if you depend on it.


> It's not just about readability, it's about making a contract with the user. If you typedef a complex struct in your library you're telling your users to treat this type like it's a black-box and not look inside because the next version of the library might contain something different and your code will break if you depend on it.

No need to use typedef, just use an opaque struct if you want something to behave like a blackbox.




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

Search: