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

I disagree with the author's example as given.

The example discusses a code boundary that is internal to a single atomic "module" - the preparation of a data structure that describes a pizza. Then the author says that bad things will happen if said code boundary is used from other modules.

However, why would an extrenal module developer do that? It is common wisdom to recognize and avoid module-internal utility functions.

Conversely, as long as the presented shortcut is internal to a module (=used only for a specific set of use cases well understood by anyone touching the code), and saves toil, it might actually be justified.



> However, why would an extrenal user do that? Potential external users typically recognize and avoid module-internal utility functions.

External users will go look the implementation of msvc's standard library and reverse engineer windows API to make things faster lol. No internal module function is ever safe.


I agree that no internal module function is safe, but MSVCRT is used by literally millions of developers, some of which have very uncommon functional requirements, such as making their product work on a rare version of Windows. My empirical observation is that most developers are prone to the other extreme of not considering internals when they should.




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

Search: