Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning Python for a .NET developer [closed]

I have been doing active development in C# for several years now. I primarily build enterprise application and in house frameworks on the .NET stack.

I've never had the need to use any other mainstream high level languages besides C# for my tasks, since .NET is the standard platform we use.

There are some legacy Python applications that I have been asked to support going forward, I have no exposure to python and dynamic languages in general(although I've done a fair bit of JavaScript).

I was hoping to get some guidance/advise to aid in how to go about learning a language like python for the statically typed mind.

EDIT: Using IronPython is not an option!

like image 999
Abhijeet Patel Avatar asked Jul 02 '09 04:07

Abhijeet Patel


3 Answers

Foord and Muirhead's IronPython in Action is an amazingly good book, perfectly suitable for teaching Python to .NET folks as well as teaching .NET to Python folks. I may be biased, as I was a tech reviewer and Foord is a friend, but I've had other cases in the past where a friend wrote a book and I tech reviewed it -- and ended up deciding the book was just wrong and publicly saying so (way to lose friends, but, I just can't tell a lie, not where Python is concerned at least!-)

Edit: If you're forbidden from moving to IronPython (which would probably support your legacy apps just fine, btw), there are better answers: Mark Pilgrim's Dive into Python is often considered the best Python intro for the experienced developer, and my own Python in a Nutshell has been praised as the fastest way onboard for superstar developers. I am of course biased in favor of these -- Mark is a colleague, and my wife was a key tech editor for his book (and my own as well), and obviously I'm biased in favor of my own book too;-). But then, I do tend to be biased towards a lot of the best Python books, as I've either had a hand in their editing, or am friends with their authors, or both;-).

like image 78
Alex Martelli Avatar answered Oct 07 '22 00:10

Alex Martelli


Hardest thing I was confronted to in using python coming from Java was to properly wrap my head around the Duck Typing thing... At first I thought it was just plain horrible and just dressed the hairs on the back on my neck.

Next is the scope by convention, but that one is pretty easy. And the importance of white spaces gave me a few bumps.

However once you ease yourself in the language's concision and speed of development you learn to appreciate it a lot more. After a while I thought it was the best thing that ever happened to me !! :-)

here are a few things that helped me a lot :

First I started with this book and got the basics of the language and for everyday use the Python Quick Reference Card was very helpful. Also the console will be your best ally to try quick things and solidify your learning.

For IDEs, coming from the eclipse world PyDev was a natural choice for me, but there were many more to choose from. But if you are more familiar to the Visual Studio environment the Python Tools for Visual Studio is pretty darn good too.

Good luck, Hopefully you'll find Python as much fun as I did.

like image 8
Newtopian Avatar answered Oct 07 '22 00:10

Newtopian


There is a big initial hurdle of getting comfortable with dynamic typing. The first step is when you look at Python-code and realize that variables aren't defined anywhere, you just create them out of thin air, which feels like jumping over a cliff. There is a brief moment before your hang glider catches the air properly.

And then it's going to take time before you trust your newfound dynamic wings, and you probably only can get their by doing aerobatics with them. Learn how python handles references, have fun with monkey-patching methods, duck type various animals. Try to learn some ugly tricks.

And although you can't use IronPython for this, there is no reason you can't use it to learn Python.

like image 4
Lennart Regebro Avatar answered Oct 06 '22 23:10

Lennart Regebro