Is python good for making database work short?

Paul McNett p at ulmcnett.com
Thu Jun 19 03:48:10 CEST 2003


Steve writes:

> Today at work I got an impressive demonstration.
> There was a database mess that had to be cleaned up fast.

> A coworker who is a foxpro nut did all of this in about 3 lines of
> code.

> I was very impressed, and I plan to learn foxpro since the job has
> legacy apps written in it.

FoxPro shines at manipulating data. There is no finer tool for that purpose.


> However I was wondering if python could have made this job this easy.
> Does python make manipulating databases and data short work?

I am a FoxPro developer switching to Python. Python offers a good DB 
specification and a bunch of modules to access any kind of backend data. 
Python also offers good basic types to store cursor-like views of the data 
(a list of dictionaries would provide a recordset-like object, where you 
can reference the fields by name).


> Part of the program we had to make also required doing many queries to
> check the integrity of the data, and if it wasn't kosher, store the
> bad data to a table for examination later.  In foxpro it was one line
> of code to save the query into a table.  In java it would have been
> another trek like the one I described above.

Yes all this stuff is built-in to fox, because of fox's xbase 
local-cursor-engine.


> Java is great for a lot of stuff, but the jdbc is basically just a
> pipe into the database to pass sql through with a lot of gymnastics to
> get the sql into, massaged and out of the pipe.
>
> Anyway, I would love to have an open source, multiplatform tool that
> could match foxpro in ease of database manipulation.

Nothing can match FoxPro in data manipulation. But FoxPro is proprietary, 
closed-source and single-platform. And it can be killed at any time 
whenever Microsoft decides to.


> Is python it?

Python is my choice for a new primary development language. I'm missing 
FoxPro's native cursor engine and XBase dialect, but am finding that Python 
can handle everything, and I'm also finding that I think I'll like Python's 
way better for the long term.

Python shares FoxPro's flexibility in many ways: no need to declare 
variables, developer-choice to do oop or procedural programming, 
developer-choice to use local database or backend db server, rapid 
prototyping, live command interpreter, etc. etc.

I'm not a Pythonista yet but think that that status isn't as far away as I 
might have thought when I started down this road 6 or so weeks ago....


-- 
Paul McNett





More information about the Python-list mailing list