Another Attempt at Python
I tried Python out a while ago, but stopped trying it to learn it after some major frustrations. Maybe I didn’t dig deep enough into it. I found the documentation hard to read, and the module layout seemed a little random at times. For some reason I found executing an external process and getting the results to be a little convoluted. (Since then I’ve learned to use popen(..).communicate())
I ended up messing with other languages to try to find one that suits my tastes, like Erlang and D. I read through 7 languages in 7 weeks, and not really getting a lot out of it. I didn’t fall in love with ruby at all and I’m not going to actually use Prolog anywhere, even if I thought it was pretty cool. I never liked Java, and I wasn’t impressed with Scala.
The closest I’ve gotten to a new favorite is Erlang. I’ve written a whole slew of posts about it. I like Erlang’s process management, message passing, and the OTP libraries. I like talking about it with people and I advocate it’s advantages. But when it comes time to write it, I find it to be clumsy and awkward, the syntax annoying and the external libraries painful. For instance, trying to work with a MongoDB database just doesn’t feel right. My mind likes OO code, and I’m done fighting it. So time to try something else.
I thought D was really interesting, but unfortunately it looks like no one is using it. It’s not even clear which compiler I should use, and the installation instructions were incorrect when I tried to set it up. Not a big selling point, and I gave that up pretty quickly.
So, another look at Python. Working with threads in Python kind of sucks. If you have multiple cores, it doesn’t really care. That’s unfortunate. However, after reading through convos in IRC (#python on freenode) I’ve found a few things that are making me give it another look. For instance, the multiprocessing module seems to address my gripes about processes / threads. Yes we’re creating OS processes, but I really only need a few (5, 10 maybe?) so having a few running shouldn’t be a problem, and the OS will take care of loading up my cores for me. It’s got great support for MongoDB (my shiny new toy) and I like it’s clean syntax. I think tornado looks really cool and I’m excited to write a stand alone server that I can bundle instead of requiring nginx configs and complicated setups.
So… I’m back writing Python. We’ll see how it goes.If you found this post helpful, please consider sharing to your network. I'm also available to help you be successful with your distributed systems! Please reach out if you're interested in working with me, and I'll be happy to schedule a free one-hour consultation.