The .NET Stacks #8: functional C# 9, .NET Foundation nominees, Azure community, more!

We discuss functional programming in C# 9, .NET Foundation updates, and more!

Dave Brock
Dave Brock

This is an archive of my weekly (free!) newsletter, -The .NET Stacks-. Consider subscribing today to get this content right away! Subscribers don’t have to wait a week to receive the content.

On tap this week:

  • C# 9: a functionally better release
  • The .NET Foundation nominees are out!
  • Dev Discussions: Michael Crump
  • Community roundup

C# 9: a functionally better release

I’ve been writing a lot about C# 9 lately. No, seriously: a lot. This week I went a little nuts with three posts: I talked about records, pattern matching, and top-level programs. I’ve been learning a ton, which is always the main goal, but what’s really interesting is how C# is starting to blur the lines between object-oriented and functional programming. Throughout the years, we’ve seen some FP concepts visit C#, but I feel this release is really kicking it up a notch.

In the not-so-distant past, discussing FP and OO meant putting up with silly dogmatic arguments that they have to be mutually exclusive. It isn’t hard to understand why: traditional concepts of OO constructs are grouping data and behavior (state) in single mutable objects, and FP draws a hard line between data and behavior in the name of purity and minimizing side effects (immutability by default).

So, typically as a .NET developer, this left you with two choices: C#, .NET’s flagship language, or F#, a wonderful functional language that is concise (no curlies or semi-colons and great type inference), convenient (functions as first-class objects), and has default immutability.

However, this is no longer a binary choice. For example, let’s look at a blog post from a few years ago that maps C# concepts to F# concepts.

  • C#/OO has variables, F#/FP has immutable values. C# 9 init-only properties and records bring that ability to C#.
  • C# has statements, F# has expressions. C# 8 introduced switch expressions and enhanced pattern matching, and has more expressions littered throughout the language now.
  • C# has objects with methods, F# has types and functions. C# 9 records are also blurring the line in this regard.

So here we are, just years after wondering if F# will ever take over C#, we see people wondering the exact opposite as Isaac Abraham asks: will C# replace F#? (Spoiler alert: no.)

There is definitely pushback in the community from C# 8 purists, to which I say: why not both? You now have the freedom to “bring in” the value of functional programming, while doing it in a familiar language. You can bring in these features, along with C#’s compatibility. These changes will not break the language. And if they don’t appeal to you, you don’t have to use them. (Of course, mixing FP and OO in C# is not always graceful and is definitely worth mentioning.)

This isn’t a C# vs F# rant, but it comes down to this: is C# with functional bits “good enough” because of your team’s skillset, comfort level, and OO needs? Or do you need a clean break, and immutability by default? As for me, I enjoy seeing these features gradually introduced. For example, C# 9 records allow you to build immutable structures but the language isn’t imposing this on you for all your objects. You need to opt in.

A more nuanced question to ask is: will C#’s functional concepts ever overpower the language and tilt the scales in FP’s direction? Soon, I’ll be interviewing Phillip Carter (the PM for F# at Microsoft) and am curious to hear what he has to say about it. Any questions? Let me know soon and I’ll be sure to include them.

The .NET Foundation nominees are out

This week, the .NET Foundation announced the Board of Director nominees for the 2020 campaign. I am familiar with most of these folks (a few are subscribers, hi!)—it’s a very strong list and you probably can’t go wrong with anyone. I’d encourage you to look at the list and all their profiles to see who you’d like to vote for (if you are a member). If not, you can apply for membership. Or, if you’re just following the progress of the foundation, that’s great too.

I know I’ve talked a lot about the Foundation lately, but this is an important moment for the .NET Foundation. The luster has worn off and it’s time to address the big questions: what exactly is the Foundation responsible for? Where is the line between “independence” and Microsoft interests? When OSS projects collide with Microsoft interests, what is the process to work through it? And will the Foundation commit itself to open communication and greater transparency?

As for me, these are the big questions I hope the nominees are thinking about, among other things.

Dev Discussions: Michael Crump

If you’ve worked on Azure, you’ve likely come across Michael Crump’s work. He started Azure Tips and Tricks, a collection of tips, videos, and talks—if it’s Azure, it’s probably there. He also runs a popular Twitch stream where he talks about various topics.

I caught up with Michael to talk about how he got to working on Azure at Microsoft, his work for the developer community, and his programming advice.

Michael Crump

My crack team of researchers tell me that you were a former Microsoft Silverlight MVP. Ah, memories. Do you miss it?

Ah, yes. I was a Microsoft MVP for 4 years, I believe. I spent a lot of time working with Silverlight because, at that time, I was working in the medical field and a lot of our doctors used Macs. Since I was a C# WinForms/WPF developer, I jumped at the chance to start using those skillsets for code that would run on PCs and Macs.

you walk me through your path to Microsoft, and what you do at Microsoft now?

I started in Mac tech support because after graduating college, Mac tech support agents were getting paid more than PC agents (supply and demand, I guess!). Then, I was a full-time software developer for about 8 years. I worked in the medical field and created a calculator that determined what amount of vitamins our pre-mature babies should take.

Well, after a while, the stress got to me and I discovered my love for teaching and started a job at Telerik as a developer advocate. Then, the opportunity came at Microsoft for a role to educate and inspire application developers. So my role today consists of developer content in many forms, and helping to set our Tier 1 event strategy for app developers.

Tell us a little about Azure Tips and Tricks. What motivated you to get started, and how can people get involved?

Azure Tips and Tricks was created because I’d find a thing or two about Azure, and forget how to do it again. It was originally designed as something just for me but many blog aggregators starting picking up on the posts and we decided to go big with it—from e-books, blog posts, videos, conference talks and stickers.

The easiest way to contribute is by clicking on the Edit Page button at the bottom of each page. You can also go to http://source.azuredev.tips to learn more.

What made you get into Twitch? What goes on in your channel?

I loved the ability to actually code and have someone watch you and help you code. The interactivity aspect and seeing the same folks come back gets you hooked.

The stream is broken down into three streams a week:

  • Azure Tips and Tricks, every Wednesday at 1 PM PST (Pacific Standard Time, America)
  • Live Interviews with Developers, every Friday at 9 AM PST (Pacific Standard Time, America)
  • Live coding/Security Sunday streams, Sundays at 10:30 AM PST (Pacific Standard Time, America)

What is your one piece of programming advice?

I actually published a list of my top 12 things every developer should know.

My top one would probably be to learn a different programming language (other than your primary language). Simply put, it broadens your perspective and permits a deeper understanding of how a computer and programming languages work.

This is only an excerpt of my talk with Michael. Read the full interview over at my website.

Community roundup

An extremely busy week, full of great content!

Microsoft

Announcements

Videos

Blog posts

Community Blogs

ASP.NET Core

Blazor

Entity Framework

Languages

Azure

Xamarin

Tools

Projects

Community podcasts and videos

New subscribers and feedback

Has this email been forwarded to you? Welcome! I’d love for you to subscribe and join the community. I promise to guard your email address with my life.

I would love to hear any feedback you have for The .NET Stacks! My goal is to make this the one-stop shop for weekly updates on developing in the .NET ecosystem, so I look forward to any feedback you can provide. You can directly reply to this email, or talk to me on Twitter as well. See you next week!

.NET Stacks