how to write a line in a text file

James Dennett jdennett at acm.org
Sun Jul 31 18:59:04 EDT 2005


Peter Hansen wrote:

> Steven D'Aprano wrote:
> 
>> On Wed, 27 Jul 2005 04:26:31 +0000, Andrew Dalke wrote:
>>
>>> This isn't 1970.  Why does your app code work directly with
>>> files?  Use a in-process database library (ZODB, SQLLite,
>>> BerkeleyDB, etc.) to maintain your system state and let the
>>> library handle transactions for you.
>>
>>
>> And when users are happy to install a relational database system in order
>> for their editor to save their letter to grandma, I'm sure your scheme
>> will work well for them.
> 
> 
> Given that ZODB and PySQLite are simply Python extension modules, which 
> get bundled by your builder tool and are therefore installed 
> transparently along with your app by your installer, this is a total 
> non-issue at least with those packages.
> 
> After all, it's not 1970 any more. ;-)

Indeed; since 1970 we learned to prefer straightforward
file formats where possible, reserving use of databases
for structured data where the extra costs are justified.

Sometime maybe databases will get better to the point
that we don't need to distinguish so much between them
and filesystems, but we're not there yet.  Managing raw
files, carefully, still has a place.

-- James



More information about the Python-list mailing list