The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘C# 10’ Category

File scoped namespaces – C# 10.0 draft specifications | Microsoft Learn

Posted by jpluimers on 2025/05/01

Oops, I thought this had been published a long time ago, but oh well: it is never too late to publish reflections on a C# programming language improvement.

After recovering from my rectum cancer treatments and finally upgrading most of my projects to recent enough C# versions, it was time to catch up on useful little C# language features released during my treatments.

This one is really nice: [Wayback/Archive] File scoped namespaces – C# 10.0 draft specifications | Microsoft Learn.

I wish it had been released much earlier, as it so much reminds me of the unit keyword in Delphi which influenced C# a lot. Well, actually the unit actually started in UCSD Pascal and Turbo Pascal; UCSD Pascal ran on the UCSD p-Machine (more on that in a future blog post), which influenced the Java Virtual Machine, which was based on Java bytecode and a Just-in-time compiler in turn influenced the .NET Common Language Runtime.

There are many examples from other languages, paradigms and frameworks: I love how C# and .NET bring so much programming history together.

In Delphiย  it is easy: a source file can contain at maximum one unit (and apart from files included in that source file, no other source files can contribute to that unit) and the filename needs to match the unitname, so the unit is a self contained namespace.

Read the rest of this entry »

Posted in .NET, About, C#, C# 10, Cancer, Delphi, Development, Java, Java Platform, Jon Skeet, Pascal, Personal, Rectum cancer, Rider from JetBrains, Software Development, Turbo Pascal, UCSD Pascal, Visual Studio and tools, vscode Visual Studio Code | Tagged: , , , , , | Leave a Comment »

sharplab.io – ashmind/SharpLab: .NET language playground

Posted by jpluimers on 2024/05/08

[Wayback/Archive] ashmind/SharpLab: .NET language playground is hosted onย [Wayback/Archive] SharpLab.ioย ย and has this README:

Read the rest of this entry »

Posted in .NET, C#, C# 10, C# 11, Development, F#, Software Development, VB.NET | Leave a Comment »

Not sure I like this without tail recursion

Posted by jpluimers on 2024/05/07

A while ago Andy Gocke posted this bit of C# 11 code:

[Wayback/Archive] Andy Gocke on Twitter: “Can’t believe none of that “C# is turning into F#” people have noted that this is legal code in C# 11″

Read the rest of this entry »

Posted in .NET, C#, C# 10, C# 11, Development, F#, Software Development | Leave a Comment »

Please do not make your C# code an obfuscation contest

Posted by jpluimers on 2024/04/23

You. This is valid C# code. Guess what it does [Wayback/Archive]:

for (
  var (f,l) = (1, 10);
  f <= 10;
  Console.WriteLine($"{f} + {l} = {f + l}"),
  f++,
  l--
);

Via [Wayback/Archive] Khalid ๐Ÿ•โ€๐Ÿฆบ๐Ÿ•๐Ÿฉ on Twitter: “Iโ€™m trying some programming in #csharp today. Am I doing this right? #dotnet”

–jeroen

Read the rest of this entry »

Posted in .NET, C#, C# 10, C# 11, Development, Software Development | Leave a Comment »