Newbie: Crazy, but Quick

Cliff Wells logiplexsoftware at earthlink.net
Fri Feb 22 18:23:24 CET 2002


On 22 Feb 2002 02:00:27 GMT
Quinn Dunkan wrote:

> On Thu, 21 Feb 2002 17:35:44 -0800, Virginia O <vodine at direct.ca> wrote:
> >Thanks, but the database will have to hold sub-groups etc. It will be
easier
> >for me to enter and organize the items in a database.
> >I only gave the scenario as an example. The actual program will hold
> >hundreds of items.
> 
> Hundreds is just fine for flat text.  If you have a few thousand and
you're
> modifying it a lot, then flat text will start being clunky.
> 
> In that case, shelve should work fine, especially for complicated data
> structures since you can dump python types directly, with no clunky
converting
> to/from some format SQL likes.  And it's much simpler to have everything
in
> python instead of a whole other database program with its own language,
etc.

For that matter, you could also store the Python objects directly in the
SQL database.  My own opinion is that SQL is so easy that it's a no-brainer
to use it whenever possible.  A problem I've seen many times is people
utilize some shortcut because they feel the program will never need
anything more, only later to discover that the program has utility far
beyond what they expected, but the shortcut they've taken cripples it, and
they end up rewriting (or worse, they don't).

What if she decides to maintain historical data?  Then to keep the files
reasonably sized, she'll have to start juggling files.

Software has a tendency to grow beyond the developer's expectations, so I
consider it unwise to take shortcuts when a better long-term solution isn't
much more difficult to implement.

Not only that, but storing the data in a SQL database separates the data
storage from the program, so in the future she could use that data from
some other program, not just the Python one.  Then if she decides she wants
to access the data from, say, a web server, it's not a big problem. 


-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308




More information about the Python-list mailing list