thomasjungblut/HamaStreaming — pull request #1 by jkleint (2012-09-19 21:50:38+00:00)
Title: Little suggestions for a more Pythonic API

First, let me say that Hama Streaming and especially a Python API is an utterly fantastic idea -- I was about to implement this myself if someone else didn't. :) Thank you!

I have just a few minor suggestions that would make the Python API a little more idiomatic.

First, we try not to break out the OOPhammer in Python unless it's really the best way to solve a problem. In this case, there's no need to subclass: notice you don't even call any methods on `self`. People will thank you kindly if you don't force OOP on them, especially when it's not necessary. This lets people use your code in the way that works best, rather than forcing a particular structure on them.

You were probably thinking you'd like to enforce the order of `setup`, then computation, then `cleanup`. No problem: give them an object to interact with, do setup in `__init__`, let them call whatever methods they want, then do cleanup in `__del__`.

Finally, Python folks prefer `lowercase_with_underscores` rather than `CamelCase` for module and function names. Just makes it feel slightly less like a Java port. ;)

Thanks again for this fantastic tool! I look forward to using it!