On Learning Python
February 17, 2007
I started off working with Microsoft products professionally, learn to write software using ANSI C and later C++ in college, did some side work on Linux using PHP/MySQL, got into professional programming with the .NET 1.0 Beta, then shifted into Oracle and Solaris for a couple of years, writing Korn Shell scripts, C, and PL/SQL with sprinklings of Java. Over the past 3 years or so, I have been solidly back in Microsoft-land.
Recently, I have started digging into Python a bit, due to a requirement that a client of mine has that at least portions of the system be written in Python on Linux. I am finding the language to be quite interesting and am curious as to how it all fits together.
Some questions that have piqued my interest:
- Why isn't encapsulation supported? There isn't the same notion of private/protected members like I am used to in more traditional OO languages.
- Are events supported? I find the feature of "everything an object" intriguing, even going so far as being able to pass around a function as a first class object. I guess in a way, this can be used similiarly as an event delegate.
- How are the mechanics different than the typical Visual Studio solution/project structure? This is a little bit less technical and more just practical. How should I approach and organize a project? Are the concepts different from one platform to the next?
- How can I be certain that the scripts haven't changed or been modified? In .NET I not only have a compiled assembly making it less prone than a text file to accidental change, but I can sign it with a public/private key pair to protect against malicious change. If the code in Python is never compiled but interpreted at runtime, how do I ensure the integrity of my application?
- What does the typical packaging and deployment of a Python app look like?
- What's the best IDE for python for a Visual Studio raised engineer (intellisense, code completion, debugger, etc.)? I am not into editing my code in a simple text editor.
- What does the typical development cycle look like? Are there unit testing frameworks for Python? A PUnit maybe?
- lamba is cool, wonder if there are best practices published out there on how best to use it and how best to prevent it from being abused -- with great power comes great responsibilty.
As I get more and more into this dynamically typed language, I am also curious about Ruby, especially Ruby on Rails. What are the differences? What are the pros and cons of each one? How do they compare? What do these two languages mean for C# 3.0 and C# 3+?