[Cs4800] Plenty of Russian Dolls

Karl Lieberherr lieber at ccs.neu.edu
Wed Feb 10 23:11:50 EST 2010


Looking through your Topological Sorting program, I found plenty of Russion
dolls.

Although this is an Algorithms course, we want to write our algorithms in
good style as taught in the Object-Oriented Design Course. No more Russian
Dolls.
Read:
http://garmhold.blogspot.com/2010/02/no-more-russian-dolls-applying-law-of.html
and related links.

Use appropriate intimacy!

Compare with Bryan Chadwick's code that I showed in class! There are no
Russian dolls in there.

-- Karl

Bad sample code:

In class TopSort:

while (graph.size() != 0) {
   ...
  graph.size();
  ...
  graph.get(i).remove();
  ...
  graph.get(i).getpreds().isEmpty()
  ...
  graph.get(i).getname();
}
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the Cs4800 mailing list