- Academic projects range in size from a few hundred Source Lines of Code (SLOCS) to perhaps 50,000 lines for group projects, like those we build in Software Studio. If printed at about 50 lines per page, not counting heading, that's a range of 4 to more than 800 pages of text.
- Professional projects range in size from perhaps 10,000 SLOCS to more than 50,000,000. The putative size of Windows XP is claimed to be 40 million lines, for example. If printed that's a range of about 170 to more than 800,000 pages of text.
- Obviously size matters! A lot of our design effort goes into managing this large volume of text, even for some academic projects, and always for professional projects.
- So, we need to partition this mass of text into parts that are small enough to be understood by one person. We do this by breaking up our source code into files, called packages, which are the smallest units of compilation.
- A well designed source package will usually have one or two classes with typically about 10 functions each which should average about 50 lines of code or less per function. Let's assume that the average module size is 1000 SLOCS.
- Consequently, an academic project will usually contain a range of packages from one to about fifty packages while a professional project will range from about 10 to 50,000 packages.
Project Type - metric | Small Project | Large Project |
Academic - line count | 200 | 50,000 |
Academic - page count | 4 | 1000 |
Academic - package count | 1 | 50 |
Professional - line count | 10,000 | 50,000,000 |
Professional - page count | 200 | 1,000,000 |
Professional - package count | 10 | 50,000 |
Conclusions for: Software Size Matters!
We should strive to reuse and salvage as much code as possible for each new project:
-
Software reuse is important.
Reuse means to use packages without changing any of their text.Compiler libraries are a good example. But we need to design our own code for reuse where that makes sense. We don't want to have to create 50,000 packages. The C++ language was designed to support reuse and we will examine how to tap into that support.
-
Software salvage is important.
Salvage means that we start with existing packages and extend them with additional packages, or modify them, as little as possible, to suit a new application.Salvage is harder to do gracefully than reuse. We will explore one elegant way to support salvage in Project #4.