Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage Language Design Content on InfoQ

  • C# 12: Preview of Three New Features Coming

    Microsoft has published the release post which covers the three exciting new features that will be included in the upcoming release of C# 12, the latest version of its popular programming language. These features include primary constructors for non-record classes and structs, using aliases for any type, and default values for lambda expression parameters.

  • C# 9: Minor Improvements for Lambdas

    Lambdas will be getting a small upgrade in C# 9 with two new features: discard parameters and static anonymous functions. Neither will change the way code is written, but they do clarify the developer’s intent.

  • C# 9: Range Operators in Switch Constructs and Pattern-Matching Expressions

    Since C# was first introduced, developers have complained about the lack of a range operator in switch constructs. This made switches far less useful in C# than they were in VB. As part of the pattern-matching enhancements for C# 9, this limitation has been addressed.

  • C# 9: New `and`, `or`, and `not` Keywords for Pattern Matching

    Though it may sound like our occasional April Fools Day joke, C# 9 is looking to add `and`, `or`, and `not` to its list of keywords. Specifically, for use in pattern matching.

  • C# Futures: Null Check Operator

    In the June 24th C# Language Design Meeting, Microsoft made a subtle change to the parameter null checking syntax. By changing it from “Type parameterName!” to “Type parameterName!!” they effectively introduced a new ‘null check operator’.

  • C# 9: Type Inference for the New Keyword

    In many situations, there is only one possible type allowed in a given place. And yet C# still requires you to explicitly list the type. Now that the Target-typed `new` expression proposal has been adopted into C# 9, such boilerplate code will no longer be necessary.

  • C# 9: Simplified Parameter Null Validation

    Simplified parameter null validation has been promoted to a C# 9 feature. This narrowly tailored feature reduces the amount of code needed to validate non-null parameters to a single character in the function signature.

  • C# 9: Partial Method Enhancements for Source Generators

    Source Generators in C# 9 will allow compiler-extensions to inspect code and then inject additional source code at compile-time. This injected code is then incorporated into the very same assembly that was being compiled. In order to facilitate this capability, Microsoft is removing most of the restrictions on Partial Methods.

  • C# 9: towards First Class Support for Scripting

    One of the defining characteristics of “scripting” languages is they don’t need any boilerplate. The very first line of a file can be the declarations and statements you would normally see inside a function. In the updated Top-level statements proposal, this capability is planned for C# 9.

  • C# Futures: Primary Constructors

    We last mentioned primary constructors in 2014 when it was removed from the candidate list for C# 6 and VB 12. Late last year, Primary Constructors reappeared as a candidate for C# 9.

  • C# Futures: Covariant Return Types

    A frequent API design problem is the inability to use a more specific return type when overriding a method. Proposal 49, which is now a C# 9 candidate, seeks to correct this issue.

  • ECMAScript's Top-Level Await Proposal Implemented in V8, Babel and Webpack

    The top-level await's ECMAScript proposal, which reached Stage 3 last year, is now implemented in the V8 JavaScript engine, and supported by Webpack and Babel. Top-level await enables dynamic dependency pathing, resource initialization, and dependency fallbacks at module import time. Top-level await results in a non-deterministic module execution order.

  • C# Futures: Simplified Parameter Null Validation

    At first glance, proposal #2145 seems like a logical extension to C# 8’s Nullable Reference Types feature. The basic idea is developers would no longer need to explicitly add argument null checks to methods that accept non-nullable parameters. However, this has become quite contentious.

  • C# 9 Proposals: Module Initializers

    The module initializer proposal has been promoted to C# 9 candidacy. This would act like a static constructor in C#, but rather than applying to one class it applies to the entire assembly.

  • Microsoft Presents Static TypeScript, a Fast Subset of TypeScript Targeting Embedded Devices

    Microsoft recently submitted a research paper introducing Static TypeScript (STS), a subset of TypeScript targeting low-resource embedded devices, to the Managed Programming Languages and Runtimes 2019 (MPLR 2019) international conference. STS programs may run on devices with only 16 kB of RAM faster than embedded interpreters would, which would extend battery life of these devices.