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 2,046 other followers

Archive for the ‘C#’ Category

SharpLab

Posted by jpluimers on 2020/07/24

This is amazing stuff: it runs your C# code through a specific version (git branch) of the C# compiler!

C#/VB/F# compiler playground. Not a Shark lab.

Source: SharpLab

Example: https://sharplab.io/#v2:EYLgtghgzgLgpgJwD4AEAMACFBGA3AWACh0tsA6AGQEsA7ARzIFEAPABwTiiioHsaoCxAMxYATBgDCAHgAqAZR4BXBAGM4AGgwyAIpxgA+DAHcAFojhbdsDCAw04RgBQBKDAG8iGL1hEt2nbj4pFABWWQVlNU0dPX1DADEeHhdPbzSAXkMwHgATOAAbDEy7B0s9F0E0lF82Di5eGmCw+SVVDTLYOIwAIQgEFMI0jKzcgqLDeyMOmHcAX0FZoA===

Via:

–jeroen

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

Nick Craver on Twitter: “I see a lot of MyEnum.Member.ToString() in code reviews across various projects – instead you should use: nameof(MyEnum.Member)”

Posted by jpluimers on 2020/06/25

I love nameof (and wish many more languages had a similar feature), but since it got introduced so late in the C# language, there is still a lot of old idiom going around. Luckily most of that are not string literals, but you see the occasional reminder to get rid of that cruft: [WayBack] Nick Craver on Twitter: “I see a lot of MyEnum.Member.ToString() in code reviews across various projects – instead you should use: nameof(MyEnum.Member)”.

Luckily, there is a Roslyn analyser for it: [WayBack] Andy Edinborough on Twitter: “Roslynator: https://t.co/3LDUG9WRvE… “.

[WayBack] GitHub – JosefPihrt/Roslynator: A collection of 190+ analyzers and 190+ refactorings for C#, powered by Roslyn.

[WayBack] Antão Almada on Twitter: “I use Enums.NET https://t.co/YaIZWpYVxJ… “ which is a cool library that I’ve used a lot:

[WayBack] GitHub – TylerBrinkley/Enums.NET: Enums.NET is a high-performance type-safe .NET enum utility library

–jeroen

Read the rest of this entry »

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

Dynamically instantiating instances in Delphi without knowing their full type is hard

Posted by jpluimers on 2020/06/17

For my reading list: [WayBack] So am working on a particular .NET project and came across NewtonSoft JSON.NET Serializer, it allows you serialize Collections such as a generic list an… – Ugochukwu Mmaduekwe – Google+:

Stefan Glienke:
Serializing and mostly deserializing generics in Delphi is a major PITA because we don’t have such capabilities to dynamically work with them like in C# where you can easily create new generic lists at runtime where you don’t know the precise type T at compile time.

–jeroen

 

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

GitHub – JensBorrisholt/GoogleSpeak: This repository demonstrates how to Use Google for implementing Text to Speech. You’ll find both a Delphi version and a C# version

Posted by jpluimers on 2020/04/15

For my link archive, as I will likely need this one day: [WayBackGitHub – JensBorrisholt/GoogleSpeak: This repository demonstrates how to Use Google for implementing Text to Speech. You’ll find both a Delphi version and a C# version

–jeroen

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

Not all XSD mappings to programming language constructs are possible

Posted by jpluimers on 2020/02/26

This post is a reminder to myself that not all mappings from XSD to programming languages are possible.

There are many impossible cases, so this is just a general reminder.

A Delphi specific case for instance is the mapping of enumerations: one reason is that XSD enumerations are case sensitive, but the Delphi language is not: [WayBackUsing XML Enumerations with Delphi XML Data Binding Wizard – Stack Overflow.

More generic examples from my answer to the above question:

  • In XSD you can derive from an existing type in two ways: extending it and limiting it. Object Oriented languages only allow you extend when deriving.
  • Delphi is not alone in these kinds of limitations. Generating wrappers from XSD schema’s is the field of specialized tools, even in the Java or .NET world.

I’ve seen horrible things with wildcards that are sort of mappable to Java, but not to C#. This could likely go on for much longer…

–jeroen

Posted in C#, Delphi, Development, Java, Java Platform, Software Development, XML, XML/XSD, XSD | 2 Comments »

 
%d bloggers like this: