[Tutor] Response to Alan re: list of lists response

Alan Gauld alan.gauld at btinternet.com
Tue Jul 13 21:15:16 CEST 2010

"Siren Saren" <siren99 at yahoo.com> wrote
> unrelated thanks: your website has been a great help

Thanks for the kind words :-)

> The idea of making this into an object appeals to me
> very much, because I've been trying to get my head around
> creating objects as well as just using them.

It has some advantages since it is possible to write functions
that are used when sorting so you can sort complex data sets
relatively easily at the macro scale of using the objects. The
comparison functions useed to sort may of course be arbitrarily
complex - but at least the higher level application code is kept

> I'm positive now that my initial message was misleading,
> given that you also responded as though I could affect
> the way my data arrived.

You gave no clue whatsoever how the data arrived.
Is it in a file? a data stream? a database?
The first thing to do in any data processing application is to read
the data into the data format that you want it to be in to do the

> Oddly, I've already tried to develop a couple of 'programs' dealing
> with data in this form-- lists where the sequence means something
> but isn't merely alternation.

I'm still not sure I understand what you mean by that. Your book/pages
and crypto examples seemed straighforward but you didn't give any
examples of what the sorted v unsorted data would look like.

> I assumed this must be a common problem but maybe
> programmers mostly deal with data that was made for their
> purposes nowadays.

Not at all but the first thing you do in any data processing problem
is take the input data and store it how you want it, not how it 
But how you want it will depend on what you are trying to do with it!
That's why the many responses vary - it depends on how you want
to manipulate it.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list