Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jeff Moore's Blog:
Documentation versus Productivity?
Apr 05, 2005 @ 12:56:57

Jeff Moore has made a new post on his blog today with yet another of the "eternal struggles" that is a constant in the PHP community - Documentation versus Productivity (sparked by this post on Alan Knowles' blog).

Require once is part of your documenation points out an interesting case.

Consider that you have two programs, A and B. A and B share some duplicated code. Since duplicate code is bad, we factor out the duplicate code into file C (for common). Both A and B include C. All is well. The code is obvious. [...] However, there is still one last code duplication between A and B. That is the include statement itself. [...] The cost? The application has a bigger learning curve for those unfamiliar with it. The benefit? The developers familiar with the application have better productivity.

With there being an issue with even just normal documentation in code (yes, I'm not one to talk, I "forget" to do it with the best of them...), self-documenting, easy-to-read/use code would be a lifesaver. I can see his point here, though...

tagged:

Link:


Trending Topics: