How-To's

.NET Annotated Monthly | February 2020

In February 1991, Sun Microsystems brought Java technology to the world! In 1996, Deep Blue was the first computer program to beat Gary Kasparov, a grandmaster in chess. What will February 2020 bring to the world?

.NET Annotated Monthly newsletter by JetBrains!

.NET news

.NET tutorials and tips

In-memory & Distributed (Redis) Caching in ASP.NET Core – Sena Kılıçarslan goes deep into Redis caching in this article.

Routing Basics in ASP.NET Core 3.0 – Matthew Jones shows some much needed basics about routing in ASP.NET Core.

How to Upload a Document in ASP.NET Core – How to upload files is something that every web developer needs to know! By Marc Clifton.

Deserializing JSON into polymorphic classes with System.Text.Json – Maarten Balliauw uses big words like “polymorphic classes” and then makes them understandable in this excellent post.

Enforcing C# EditorConfig formatting conventions at build time – Philip W. demystifies editorconfig.

Being More Productive With The JetBrains Rider Debugger – This is a “must read” piece on debugging in Rider by Khalid Abuhakmeh. Also by Khalid, .NET Core 3.0 AllowSynchronousIO Workaround.

Behind the compiler: 20 examples of C# code before and after compiling – Several fun and interesting C# examples by Gunnar Peipman.

Blazor State Management – We can’t always escape state. So Jeremy Likness shows you how to properly manage it.

Become a better developer by reading source code – In order to write code well, you need to be able to read it. Learn how with this post by Steve Gordon.

Avoiding Parking Fines with Blazor and Geolocation – It’s not often that you get a hands on tutorial showing how to avoid parking fines! So check out this one by Ondřej Polesný. Wouldn’t it be great if you could write code to pay your current parking tickets too?

Building an ASP.NET Web API with ASP.NET Core – Damir Imangul takes us back to the basics of API building in this tutorial.

Dumping stack objects with ClrMD – Some notes on working with stack objects by Kevin Grosse.

The Reunification of .NET 5 – Matthew MacDonald takes you on a journey from the past to the future in the world of .NET.

Community and culture

This is an excellent Twitter thread by Sarah Mei on how communication skills shape code bases. Read the whole thread here.
I talk a lot about how you can’t be a great developer without great communication skills, but I don’t think people grok how _directly_ your communication skills are reflected in your codebase. Let me give you an example. (She continues with a thread)

How To Find A Mentor At Your Company – We know we should have a mentor. But how do you find a good one? In this post, Alina Serbina shows us just that.

Why ethics and contributor behavior matters in open source – Coraline Ehmke lays out facts about ethics and their importance. Don’t just assume you know what ethics are either, they can vary between cultures and what’s ethical isn’t always clear cut. Read on and find out more.

Accessibility Guidelines and Tools: How Do I Know My Website Is Accessible? – Excellent question that not enough developers ask themselves. Ashleigh Lodge reveals techniques to demonstrate that your software is accessible.

Random interesting and cool stuff

The Next Decade of .NET Open Source – Aaron Stannard lays out what could be in store for .NET folks in response to concerns over where OSS is heading.

Check out this tweet that perfectly captures the essence of programming from CodeWisdom.

'A computer is like a mischievous genie. It will give you exactly what you ask for, but not always what you want.' - Joe Sondow

Why you should consider bypassing app stores to reach new audiences – Peggy Anne Salz describes some good reason to skip app stores in favor of publishing elsewhere.

And finally…

Here’s a chance to catch up on JetBrains news that you might have missed:

Meet up with the JetBrains .NET Advocates at your favorite events:

Check out this fantastic offer! CODE Magazine is offering a free subscription to JetBrains customers!

If you have any interesting or useful .NET or general programming news to share via .NET Annotated Monthly, leave a comment here, email me at rachel.appel@jetbrains.com, or drop me a message via Twitter.

Subscribe to .NET Annotated!

Discover more

Refactor code to use new C# language features

重构代码以使用新的 C# 语言功能

在使用任何语言时,向现代语言功能进行现代化改造或迁移有助于提高代码的可读性、效率和安全性。在这篇博文中,我们将研究对代码进行现代化改造的方式,从而优化代码。 利用现代语言功能 为何只为使代码现代化就要重构代码?倘若完好,何必修正?有时,人们会有充分的理由去升级或迁移到新版本的平台或语言。例如,语言逐渐演变并添加了功能,以便利用操作系统功能、设备和浏览器功能、云或其他技术。此外,语言更新还包括引入错误修正、更简洁的语法和语法糖,以及更高效的对象和数据处理方式。 对代码进行现代化改造的重构可以通过提高可读性和可维护性来显著提高代码质量。这是因为随着语言的逐渐演变,新添加的语法往往会有助于减少您必须编写的代码行数并降低代码的复杂性。 ReSharper 和 Rider 等工具可以帮助您实现代码库的现代化。它们会随时更新以支持 .NET 语言的新功能,并且可以在有机会充分利用这些功能时提供建议。附带的好处是,这些建议有助于使您的团队不断更新自身的 C# 技能。 顶级语句 顶级语句在 C# 9 中引入,使您无需恪守显式定义命名空间或类的旧规即可立即开始编写代码。在引入顶级语句之前,即使是打印单个“Hello World”风格消息的最基础应用,也需要包含三层嵌套中括号才能支持一行实际运行代码。这样就会牵扯到大量不必要的样板代码。这真的有必要吗? usi