Top Banner
Python for the C# developer by Michael Kennedy DevelopMentor | @mkennedy | michaelckennedy.net
24

Python for the C# developer

Aug 26, 2014

Download

Technology

Michael Kennedy

Video at: http://www.develop.com/webcasts/watch/528febe6d588bf0a1c55306e/python-for-the-csharp-developer

If you love C# and .NET, you may be surprised to see how many of the features you love also exist in Python (often first). Python is a wonderful language. It is a clean high-level language which values readability over many trade-offs. You can build web applications serving billions of monthly page views. You can build cross-platform GUI applications such as DropBox. You can access amazingly powerful database servers such as MongoDB and SQL Server. But did you know many of the things you absolutely love about C# also exist in Python? Lambda expressions - check. foreach loops - check. Rich class library - check. Iterators - check. And there is more. Come learn about all the things you love from C# and see how they are accomplished in Python.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Python for the C# developer

Python for the C# developer

by Michael KennedyDevelopMentor | @mkennedy | michaelckennedy.net

Page 2: Python for the C# developer

Agenda

● Introduce the basics of the Python language

● Review what is awesome about C# and .NET

● Explore Python's version of each C# / .NET feature

Page 3: Python for the C# developer

● Batteries included (large standard library)● High-level programming language● Interpreted (sometimes JIT compiled)● Object-oriented (especially Python 3)● Strongly-typed with dynamic semantics● Syntax emphasizes readability● Supports modules and packages

The Python language in 10 minutes

Page 4: Python for the C# developer

The ‘shape’ of a Python program

● Python defines code blocks

(known as suites in Python)

using whitespace and colons.

Page 5: Python for the C# developer

Demo

Python language demo

Page 6: Python for the C# developer

What's awesome about C# and .NET?

System.Object: Everything is an object. LINQ

IEnumerable + foreach loops Visual Studio / IDEs

Class properties ( int Age {get; set;} ) Side-by-side execution (isolation)

Anonymous types Iterator methods / yield return

Add reference Anonymous methods / lambdas / closures

NuGET package management Base class libraries

Entity Framework / ORMs JIT compilation

Great debugging tools Resharper and IDE plugins

ASP.NET MVC GUI designers

Page 7: Python for the C# developer

Visual Studio

C# Python

http://pytools.codeplex.com/

Page 8: Python for the C# developer

IDEs

C# Python

http://www.jetbrains.com/pycharm/

Page 9: Python for the C# developer

Great debuggers

C# Python

Page 10: Python for the C# developer

Everything is an object

C# Python

Page 11: Python for the C# developer

IEnumerable + foreach loops

C# Python

Page 12: Python for the C# developer

IEnumerable + foreach loops

C# Python

Page 13: Python for the C# developer

PropertiesC# Python

Page 14: Python for the C# developer

Anonymous objects

C# Python

Page 15: Python for the C# developer

Lambda expressions

C# Python

Page 16: Python for the C# developer

LINQ

C# Python

Page 17: Python for the C# developer

NuGET package management

C# Python

Page 18: Python for the C# developer

NuGET package management

17,326 packages 37,571 packages

Page 19: Python for the C# developer

Iterator methods / yield return

C# code Python code

Page 20: Python for the C# developer

ASP.NET MVC

C# Python

Page 21: Python for the C# developer

Entity Framework

C# Python

Page 22: Python for the C# developer

JIT Compilation

C# Python

JIT compilation via CLR

Page 23: Python for the C# developer

GUI Designer

C# Python

Page 24: Python for the C# developer

Summary: Python for the C# developer

● Python language is simple, concise, and readable

● Many parts of C# and .NET are awesome

● Python often has equivalent features

○ sometimes nicer

○ sometimes less nice

● Python has a very capable IDE / Debugger in PyCharm