(with even more apologies to webmat)
Python will get under your skin. You will miss its features and quirks when you're not using it. You might even find other languages insufferable, once you get comfortable with Python.
After you've started using Python, there's a significant chance you'll start loathing whatever code base you currently have to work on. Especially if it's a statically compiled language. A code base you used to think was ok, except for its few quirks.
After a while of perusing the different Python-related blogs, you'll have heard other Pythonistas speak of their work with words like beauty, productivity, expressiveness, conciseness, fun and you'll realize just how far your current language is taking you from all of these words.
You'll see
DictionarysomeDic = new Dictionary ();
And dream of
someDic = {}
You'll see multiple declarations for the same method, trying to emulate optional parameters and think of Python's positional, list and keyword parameters, where such a simple method as:
def method_with_options(self, **kwargs):
encoding = kwargs.pop('encoding', 'utf-8')
print "Other options detected:", ' '.join(kwargs.keys())
#...
Enables all of the following uses
obj.method_with_options(encoding='utf-16', other_option=1) obj.method_with_options(encoding='utf-16') obj.method_with_options(other_option=1) obj.method_with_options()
You'll hear about metaprogramming and the complex syntax or frameworks that can bend Java, C# or C++ to allow a programmer to achieve what he seeks.
In the back of your head, you'll think of the insane flexibility allowed by
- simple Python syntax for method chaining or redefinition;
- dynamic class definition, that lets you add methods to any existing class, even Python's core classes;
- duck typing, where objects of any type can be passed to a method, as long as it responds to the expected method calls in a reasonable fashion;
and oh so many other Python niceties.
You'll encounter twisted method definitions such as
bool SomeMethod(int param1, ref SomeClass someClass, out SomeEnum resultType, out string result)
and think of Python's multiple returns that allows you to clearly define what's a return value and what's a parameter:
success, resultType, result = some_method(param1, someClass)
You'll delve into huge, puzzling class hierarchies that struggle just to use the right abstraction level for class names\u2026 You'll eventually realize that the whole hierarchy was simply there to share a few methods among loosely similar classes.
Then you'll really get irritated at all the accidental complexity that could have been avoided by simply using mixins, where you define a common method and then include it in any appropriate class. And all of this without ever puzzling over strange abstract names for classes that happen to sit between 2 clear-cut levels of abstraction.
You'll want to explore a new part of the .Net API by playing with it. You'll create a dummy project in some random directory, find a name for it, include the proper parts of the API in the generic main class created by default and finally start playing with the construct of interest.
All this time you'll be thinking of Python/IPython/IDLE, all Python interactive consoles. They not only allow you to play with an existing API with absolutely no fuss, but thanks to Python's flexibility, you can even define classes in the console and then play with them!
But then you'll think "Oh yeah, Python is in fact so flexible that I could use it from a frickin' web page (with a tutorial)!" And you'll realize its so flexible that it would be unwise to do so, unless you *really* trust the chroot jail you to run it from. So you'll fire up a local Python session and go play there for a couple minutes (when no one's looking), just to keep you sane for a couple more hours. Until the C++ / C# / Java drudgery is over for the day.
You've been warned. If you learn Python, you'll start thinking it's impossible for you to keep using the technology you're currently using at work. If you're patient you'll try to introduce it there gently (and most likely get frustrated at the time it takes). If you're not so patient, you'll just end up changing job.
While I don't get to work with Python full time, its 'Batteries Included' approach and excellent readability keeps me coming back.