[Alexandria-list] Reading upc barcodes patch
Laurent Sansonetti
lrz at gnome.org
Tue May 10 11:34:50 EDT 2005
Hi,
Sorry for the late response.
> Hello there!
>
> This is my first attempt at modifying alexandria to cope with upc-a
> (american) barcodes. What I ended up with was a very long case
> statement. (Sorry, I'm not a great coder!)
>
> If anybody has got some upc-a barcode books, generally paperbacks from
> america that have a barcode that doesn't begin with 978, please try it
> out.
>
> If anybody has some advice on how to make the code more
> efficient/cleaner please let me know! (I want to learn!)
>
The patch seems good, though I did not test it yet.
I would suggest you to follow Zachary's advice, using a lookup table
instead of a long switch statement. This is definitely cleaner, it makes
to code easier to maintain.
I will then merge your patch :)
Thanks
--
Laurent
More information about the Alexandria-list
mailing list