JV Sketches

 

Home
Up
JV Script
JV Sketches

 

Sketching algorithms clearly using a structured notation is a valuable analytical skill.  

I use and teach Warnier-Orr diagrams and the first two sketches below are examples of them.  Pseudocode can be a fine tool leading to structured solutions, but only if the pseudocoder chooses words carefully and takes care with indentation & placement of words to highlight the logical structures of the pseudocoded algorithm.  Using Warnier's brackets & logical connectives the way he intended them forces a structured solution that highlights the logic.

Review the references on structure for more details now that we have an algorithm in mind that needs diagramming.

 

How much detail should be included in the sketch?  As much as is needed to get the point across to another programmer or to guide your effort in coding.

Following is my favorite sketch from this Quiz.  It is very sketchy and doesn't scan too well, but it gets the idea across with elegance and even though it's missing a FETCH it would be very easy to correct so I included it here:

JVSketch1.JPG (20417 bytes)

This sketch assumes that the programmer knows how to concatenate strings together, format dollars and cents into a string with no decimal point, create a mail session.  It's not a complete solution, is far from perfect, and would no doubt be improved with another draft.  For Quiz #3 I'll want more like perfection, but since Quiz #2 was the first chance for feedback on these things.  

Here's another of the best of the lot.  This one has practically one-to-one correspondence with the lines of code and includes practically all of the syntax needed in the script.  There's nothing wrong with too much detail, but this lady could have been done with the quiz a lot faster and gotten the algorithm across just as well with half of the detail...

JVSketch2.JPG (30021 bytes)

A sketch with this much detail would be very time consuming to revise if done on paper. If this level of detail is required in the project, I'd suggest B-Liner or other graphic tool so that revisions can be made easily as the algorithm is developed and documented.  This wasn't an option, of course, for this quiz and I admire the talent shown here in packing all this onto one page, showing the GUI, and clearly outlining all the logic of this script.

 

Here's an attempt at pseudocoding that got all its points along with a request to work toward a style that highlights the logical structures involved.  The student let me know that he knows what's involved, but pseudocoded algorithms shown for Quiz #3 will need to use indentation and structured keywords (LOOP UNTIL, LOOP WHILE, IF/THEN, &c) in order to get full credit.  The goal of pseudocoded sketches should be to highlight the logical structures and freely-formatted paragraphs don't help much with this.

This one is sort of a jumble:

JVSketch3.JPG (28016 bytes)

It has some merit and could easily be turned into a structured solution.

Here's a much better pseudocoded sketch.  It includes a lot of detail, but it uses step numbers plus indentation to highlight the logical structure of the algorithm.  

JVSketch4.jpg (30726 bytes)

 

These are offered as examples to help towards developing a clear, concise style for sketching algorithms.  Object Orientation gets the spotlight at the start of the new millennium, and OO concepts and tools are absolutely required to make today's complex system objects interact.  Where scripts & code are important, and I believe they will continue to be for many years to come & at most levels of systems work, there is no substitute for Structure and the ability to arrive at a well structured solution will continue to be a valuable skill.

 

 

Hit Counter

 

Back ] Home ] Up ]
Last modified: Tuesday January 15, 2002.