//build 2020 announcements and the long run of the pythonic C#
Marco Parenzan
Chief Architect in beanTech, Microsoft MVP on Azure IoT, 1nn0va Community Lead, Industrial Enthusiast and Missed Researcher
//build 2020 has shared with the world a new impressive set of services, tools, functionalities, in Azure and beyond we can use in our solutions: you can find them summarized in the Book of News.
One of my favourites is the relaunch of Digital Twins, that after more that a year when I invested time studying it (you find my session decks here) and being "suspended in developement", it will be revamped in summer (cannot wait!).
My current focus during work is on Data and AI solutions: being a developer, besides a solution sales at #insight, the most important way for me in explaining solutions is demonstrating potentiality in technology adoption with demos. But we know that Data and AI solution is mainly a pythonic world. As I explain polyglot programming when I talk about microservices approach, I still believe that from a company (and overall personal) point of view, it is an opportunity than CAN be used but NOT MUST be used: finding almost one way to source code is better for training and governance approach into development.
This is why I started approaching Data and AI solutions as a developer when C#, my main development language, is receiving the right attention and respect into this world: for example Spark has now its own implementation for the C# binding. (for example I'm fighting with current implementation of tensorflow.net).
You can think "learn python!". I have my personal concerns with Python, mainly philosophical: I have build a career on some pillars and .NET is one of them. But now it is mostly practical: I have no time to be focused, efficient and productive with Python.
That said, I think that the most important announcement (at least for me) at //build 2020, besides the .NET 5.0 unification and finally a major uptake on desktop development with MAUI (and the revolutionary approach to SPA and PWA development with Blazor), is the C# 9.0 update.
Everyone who knows me followed my sessions with 1nn0va and lessons in University that I love the consistent C# evolution since C# 3.0 and Linq. I love the trending topic that runs every major C# release. Since C# 7.x and about 8 releases (counting major and minor), they are all focused on fluent data handling with nice functional approach and pattern matching, evolution of object oriented development with init-only properties, the long-awaited invariant records and wonderful covariant returns (an implicit way to use polymorphic generics members).
But I have to say that the most important feature for C# 9 is top-level programs. What is this feature? The classic "first program" in any language, is the "Hello World" program. Historically, C# Hello world is this:
using System; class Program { static void Main() { Console.WriteLine("Hello World!"); } }
Now, with top-level programs, becomes this:
using System; Console.WriteLine("Hello World!");
Why is this so important? First and foremost, we need to recall two important things.
The entry point of every C# application is "a static Main method in a class of one and only one class in a exe assembly". We know it and explain and teach this since day 1 of C#. main method is the heritage of C language-based families (as entry point) and Java inspiration (as a class-based language).
But we also know that this is a C# feature, not a .NET feature. VB.NET has this since 1.0 version (in modules and not in classes), in F# and also in C#. Mono introduced that long time ago and the we had C# scripting flavors with C# 4.0 with dynamic keyword and dynamic Iron* languages and .NET Interactive which is also basis for .NET bindings in Jupyter notebooks.
Again, why it is so important? Well, this is mostly personal. I'm a father of a 14 years old boy that has started a technical school, has started writing code. Which language have I sad him to learn? Well...Python.
I have always taught in C# classes in professional classes or university-grade classes and I had never fear to teach in lesson 1 what are "using", "namespace", "class", "Main", and so on. But approaching a modern 14 years old boy (or less) is a very different, difficult and engaging thing. One of the most important lesson learned as a father, is that what you would like for you children and what you have to plan for your children and what they will do are very different things. To motivate him towards programming, I say that "data science" is one of the jobs in the future for him and Python is king in that.
Python has two main values:
- data modeling, functional, language features, that we already know in C#, again, since C# 7.x development
- imperative, not-object oriented alternative approach, beside classes.
These two features makes Python "simple" to learn (yes, there is also the lack of static typing, but ok...we can discuss...as C# and Python are still strongly typed and thinking about types is just something about explicit vs implicit typing and readable code). Infact the data orientation of C# since 7.x versions, can be better called a "pythonic road" for C#.
C# is a wonderful language, but its focus on enterprise features distracted everyone on one important topic that is trending now: engaging people and "millenials". These language features make Python engaging for the new generation of developers. C# 9 will finally complete filling the gap with Python.
But then we need to work on new generations directly and C# have to work on this. C# is not taught in school classes and we loose opportunity to have C# resources ready from day 1, so another important //build announcement is the learning initiatives and the revamping the Microsoft Student Ambassador program.
I'm now involved in school or company training anymore. I'm only interested to come back to my son and tell him "keep your python skill and make a move back to me with C#".
It is a great time to be a Microsoft developer now and I'm proud to be part of this!
Marco