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

Which is fine, but if the chain is getting too deep you probably have excessive granularity and/or complexity. Foo could be defined in the same header as Bar if they are always used together. I still can't see getting anywhere near 300 levels deep in this stuff. You can also forward declare Foo in the header if it's just referenced via pointers in Bar.

This is the type of complexity that a good software "architect" should be trying to reduce rather than manage.



Sure, but once you stray from blanket rules, it's harder to state categorically that 300 is an imperative to fix, and harder to prevent it occurring.

e.g. a blanket rule that a header file isn't allowed to include another header file is trivial to enforce, one which says it can't be more than n deep, is subject to boundary pushing.




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

Search: