Modern Programming: Object Oriented Programming and Best Practices by Graham Lee
Author:Graham Lee
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2019-06-26T16:00:00+00:00
Documentation Is More Useful Than You Might Think
A common reason given for not documenting code is that the source code is accurate documentation—http://www.codinghorror.com/blog/2012/04/learn-to-read-the-source-luke.html; that, while documentation can be created with errors in it or can become inaccurate as the software changes, the source is guaranteed to be both an exactly accurate and exactly precise description of what the software does.
If you assume that framework and compiler bugs don't exist, then this idea is correct: the source is complete and exact documentation of the software's behavior. The problem is, it's not always the most appropriate documentation to read.
Sure, source code is entirely accurate, but it's also at the lowest possible level of abstraction. If you've just been brought onto a project and need to get to grips with the unfamiliar software, reading each operation in sequence (once you've even worked out the correct sequence) is not the easiest way to proceed.
Even if you leave this point aside, there are still problems with using source code as your only source of information about the software. It does indeed tell you exactly what the product does. Given a bit of time studying, you can discover how it does it, too. But will the programming language instructions tell you why the software does what it does? Is that weird if statement there to fix a bug reported by a customer? Maybe it's there to work around a problem in the APIs? Maybe the original developer just couldn't work out a different way to solve the problem.
So, good documentation should tell you why the code does what it does, and also let you quickly discover how. It should provide the context at the expense of the details, whereas the source provides all of the details at the expense of making the context hard to discover. In other words, where the source code represents an exact plan to the virtual world you're creating, your documentation should be the tourist's guide—http://www.infoq.com/presentations/The-Frustrated-Architect (This idea was first presented, to my knowledge, by Simon Brown—http://www.codingthearchitecture.com), with maps, recommendations of places to go (and to avoid), and information about world history.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(25294)
Hello! Python by Anthony Briggs(24339)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(23433)
Kotlin in Action by Dmitry Jemerov(22512)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(21976)
Dependency Injection in .NET by Mark Seemann(21847)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(20711)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(19523)
Grails in Action by Glen Smith Peter Ledbrook(18607)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17034)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(15843)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(13690)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11857)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11151)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10621)
Hit Refresh by Satya Nadella(9202)
The Kubernetes Operator Framework Book by Michael Dame(8570)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8407)
Robo-Advisor with Python by Aki Ranin(8361)