View Single Post
Old 09-21-2005, 09:13 AM   #28
kbyrd
Maximum Bitrate
 
kbyrd's Avatar
 
Join Date: Nov 2003
Location: Mountain View, CA
Posts: 485
Quote: Originally Posted by pkg
How are you scanning the song names and info to the sqlite database? c++ or script? I am working out this issue and am weighing which way to go.

A disclaimer:
I'm not running a Linux front end (yet), but I do know my way around software and Linux.

I've done a lot of data parsing work, loading things into this format, that format, in various programming languages, etc. Are you planning on parsing, manipulating, screening the input (file paths, id3 tag fields, etc.) while you load or are you just going to trust the input? How much control and feedback do you need over the loading process while it runs? Think about it for a bit. I've got mp3s that I "auto-tagged" with cddb/freedb and they have junk characters in the id3 tags. I'm slowly getting them out, but passing these characters to your sqlite db then later on to your UI could cause problems.

- If you was doing this and I had to do significant parsing, screening, checking of the input, I would not do it in C/C++. Obviously it can be done and sometimes it's the right choice, but I'm lazy and would prefer to have it done and work on something else. I also don't like writing parsers (or lots string manipulation) in C when I can whip something up in Perl (insert today's popular scripting language here). Perl (and others) have great text processing and surely have sqlite bindings for the language. This leads to more of a "just kick off this script and let it run" type of solution. It also means you've got one more piece (the script file) to keep track of on the installed machine.

- If the loading process is really just about taking the input as is, the you should integrate it more into the main app as a function call in C/C++. The advantages here is that there's no extra requirement for another language runtime on the installed machine, no extra script file to install and keep track of, and you can probably get progress/control the (sometimes) long loading process a bit better.

Of course, the advantages and problems I listed for each implementation aren't absolutes, you can certainly get progress/control a perl script from C pretty well, it's just that it's one more thing to do. You can also write advanced parsers in C/C++ and do all kinds of great pointer arithmetic, but it's really, really, simple in a scripting language like Perl that has regexp as a built-in.
__________________
In the service of a vengeful God.

My worklog.
Status: First carPC installed, uninstall, and selling off parts soon.
kbyrd is offline   Reply With Quote