Lecture Notes for Advanced Programming II

16 October 2001 - Assignment 2 Code Review


Design Principle


Properly Formatting Trees


Simple Child Positioning


What's Wrong?


Boundary Child Positioning


Algorithm Estimates


Line Statistics - Newlines

3004005006007008009001000
01
1021
20121
3011
4011
50
60111
7011
801
90131
Totals57611012

Statistics derived from all files ending in .cc, .cpp, .CC, .C, and .h.


Line Statistics - Semicolons

100200300400
03
101
2011
3013
401
5011
601
703
8021
90111
Totals101111

Statistics derived from all files ending in .cc, .cpp, .CC, .C, and .h.


Procedure Statistics

total30-line pages per procedure
procs1234567891011
11
11
211
4211
4211
541
72311
83221
83311
10721
129111
13922
1512111
161411
19172
201721
282611
35302111

Statistics derived from all files ending in .cc, .cpp, .CC, .C, and .h.


File Statistics

File
Counts
CountAverage
Lines/File
Avg Semicolons
per File
111420191
24274111
3521481
4220159
50
60
70
80
90
10110642

Statistics derived from all files ending in .cc, .cpp, .CC, .C, and .h.


How People Lost Points


Follow the Directions


Think Before You Type


Don't use Character Arrays


Dynamic Memory is Not Your Friend


Don't Use Character Arrays


Don't Use Dynamic Memory


Another Clue - Repeated Code is Bad Code


A Repeated Code Example


This page last modified on 6 December 2001.