Search code examples
pythoncollective-intelligence

Python and Collective Intelligence


I'm currently reading a great book called 'Programming Collective Intelligence' by Toby Segaran (which i highly recommend)

The code examples are all written in Python, and as I have already learnt one new language this year (graduating from VB.net to C#) i'm not keen to jump on another learning curve.

This leaves my with the issue of translating the python examples into C#.

Question is: How critical is it that the code stay in python? Are there thing in python that I can't do in a normal managed statically typed language?


Solution

  • One challenge you'll find is that not only are the algorithms implemented in Python, but the book makes extensive use of Python libraries like BeautifulSoup, Numpy, PIL, and others (see appendix A).

    I doubt there are any specifics of the algorithms that you couldn't port to another language, but you'll have trouble working through the exercises. Also, to translate the code, you'll have to learn Python at least a little bit, no?

    I suggest you just dive in and learn Python. You can use IronPython if you have any concern about interoperability with your C# projects.