Critiquing my first Python script
Posted
by tipu
on Stack Overflow
See other posts from Stack Overflow
or by tipu
Published on 2010-05-03T17:01:27Z
Indexed on
2010/05/03
17:48 UTC
Read the original article
Hit count: 350
A little bit of background: I'm building an inverted index for a search engine. I was originally using PHP, but because of the amount of times I needed to write to disk, I wanted to make a threaded indexer.
There's a problem with that because PHP is not thread safe. I then tried Java, but I ended up with at least 20 try catch blocks because of the JSON data structure I was using and working with files. The code was just too big and ugly.
Then I figured I should pick up some Python because it's flexible like PHP but also thread safe. Though I'm open to all criticism, what I'd like to learn is the shortcuts that the Python language/library provides that I skipped over. This is a PHP-afide Python script because all I really did was translate the PHP script line by line to what I thought was it's Python equivalent. Thanks.
© Stack Overflow or respective owner