> An example of a simple plan is a simple "find" plan:
> iterate through the set
>         test each set member to see if it is the target; if it is, end the iteration

Most computer scientists would (hopefully) call this the linear search algorithm -- 
and therefore be very worried about using it
because it is O(n), proper searching should be O(log(n)) (binary chop and binary tree 
search) or O(1) (hash table).

So what is the relationship between a plan in the above sense and an algorithm?

I had always thought of plans as more implementation related rather than algorithm 
related but then maybe that is my problem?

Interestingly, and why I readdressed this old (2 days:-) email, is that in languages 
like C++ and Java (also C# I guess) you can
say:

C++

    thing aThing ;
    set<thing> x ;
    ...
    bool isIn = x.count(aThing) != 0 ;

Java

    Thing aThing ;
    Set s = new HashSet () ;
    ...
    boolean isIn = s.contains(aThing) ;

This means that the issue of finding is not a general programmer issue in these 
languages (but is thing that the developer of the
type must deal with).  It never ceases to amaze me how many professional programmers 
coming from C or other languages to C++ and
Java fail to make the switch from always implementing all algorithms to actually using 
the features available in a given type.

I think there is an issue here that needs to be addressed:  How to support the 
professional programming community in their duty
to keep themselves properly updated.

The issue for the PPIG community is, I guess, how to build information and knowledge 
about how to transfer algorithm and
programming idioms from one language to another

Of course, if we knew what the cognitive issues were associated with each language and 
how to transform between them it would
help.

Russel.
======================================================================
Professor Russel Winder         Professor of Computing Science
Department of Computer Science  Fax: +44 20 7848 2851/+44 20 7848 2913
King's College London           [EMAIL PROTECTED]
Strand, London WC2R 2LS, UK     http://www.dcs.kcl.ac.uk/staff/russel/





- Automatic footer for [EMAIL PROTECTED] ----------------------------------
To unsubscribe from this list, mail [EMAIL PROTECTED]  unsubscribe discuss
To join the announcements list, mail [EMAIL PROTECTED] subscribe announce
To receive a help file, mail [EMAIL PROTECTED]         help
This list is archived at http://www.mail-archive.com/discuss%40ppig.org/
If you have any problems or questions, please mail [EMAIL PROTECTED]

Reply via email to