Catching Save - newbie

Peter Hansen peter at engcorp.com
Wed Apr 16 08:58:26 EDT 2003


Vahur Lokk wrote:
> 
> I wanted to build a simplistic? document management system. For example,
> I've got folder for letters out as well as project-based folders. I would
> save the letter in Letters Out folder and a symlink created in respective
> project folder etc. Programs that create such files are different - office
> suite, mail client (attachments coming in), browser (files from web).
> 
> I have learned programming some 15 years ago (BASIC) and wanted to re-learn
> it and am looking for some small project for a start.
> File system drivers do not sound like a newbie project, though. Polling file
> system for changes did come to my mind as a solution, but it seems like
> very resource-hungry way to do things.

One of the most important things to learn as a programmer is this,
as stated by various people but most popularly attributed to Knuth:
"Premature optimization is the root of all evil in programming."
Basically, worrying about whether something is "resource-hungry" 
before you've actually tested it out is premature optimization.

Why not write a little program that *does* poll for changes 
(maybe just limiting it to one folder as you describe above), 
and see how bad it is.  I assure you, unless you try to poll on 
the order of every tenth of a second, it won't be too resource-
hungry unless you've implemented it very poorly.

Meanwhile, you've learned more about your problem, you've learned 
more about Python, you've learned more about programming, and 
you've quite possibly got yourself a working solution with
adequate performance, and *that's more than most software projects
ever produce*!

-Peter




More information about the Python-list mailing list