Resume for Steven E. Newton


Readings for Code Janitors


Steven E. Newton
Crater Moon Development
© 2003-2014

Reporting Is A Code Smell

15 Apr 2014 358 words. (2 min)

Reporting is a code smell because:

  • It’s an indicator of incomplete or vague user needs. Essentially, a request for a report means “Gather a bunch of data and show it to me nicely formatted”. Fine, but what exactly do all the pretty rows and columns tell you? Discover the true “why” for the report, and the need for the report evaporates.
  • Reporting tools often cast domain objects in the role of dumb data containers. Instead of having useful business-oriented behavior, classes that otherwise would define suitable behaviors are diminished to just carrying around values from one location (usually an RDBMS) to another location, a piece of paper.
  • There is a certain implication that the reports, once defined and written, never change and will always be what is necessary. Stories of reports that continue for years being generated and sent to people who never use them or even know why they are getting them are not uncommon.
  • The typical reporting run, being a batch-and-queue process, can wreak havoc with the functioning an interactive system while the reporting is occurring. Reports against databases often do expensive table scans, killing performance for users doing transactional work. They exercise the object model in ways that are different enough from live transactional usage, and the tradeoffs between what’s right for reporting and what’s right for interactive are difficult to resolve.
  • The request for a report is often a sign of an implicit idea that the computer can only do “data processing”, and that the real analysis can only be done by hand. While that is still true for many classes of problems, the ability of programmers and systems to simulate and analyse is well advanced.
  • Reports are often artifacts of times before the user interface hardware and software had reasonable formatting capabilities. Low-resolution screens and the limited ability of a screen print to a low-quality local printer, for example, compared to the capabilities of generating formatted output to a centralized quality line printer. With modern user interfaces and hardware, the information is often presentable on the visual, and if not, printing from the application in suitably formatted and high-quality manner is quite easy.
<-Defect Reporting