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,862 other subscribers

Archive for the ‘.NET’ Category

PowerShell: playing around with Get-PnpDevice filtering with -Class and -Status

Posted by jpluimers on 2025/07/29

I while ago I was playing around in PowerShell with Get-PnpDevice (which got introduced in Windows 10 and Windows Server 2019):

[Wayback/Archive] Jeroen Wiert Pluimers: “@jilles_com … this is the difference between only connected disks versus including ones that had been connected in the past.Output difference between Get-PnpDevice -Class DiskDrive -Status OK Get-PnpDevice -Class DiskDrive …” – Mastodon

Read the rest of this entry »

Posted in .NET, Batch-Files, CommandLine, Development, Power User, PowerShell, PowerShell, Scripting, Software Development, Windows, Windows 10, Windows 11 | Leave a Comment »

Overlay of commands / shortcuts / keys pressed – Screencast Mode · Issue #981 · microsoft/PowerToys · GitHub

Posted by jpluimers on 2025/07/23

This is a reminder to check if this below late 2019 proposal inspired by Visual Studio Code Screencast mode¹ already made it: [Wayback/Archive] Overlay of commands / shortcuts / keys pressed – Screencast Mode · Issue #981 · microsoft/PowerToys · GitHub which mentions some tools that can already do this

Here is a list of FOSS apps that currently do this (sorted by stars):

To add to this list (unsorted):

In the meantime, I am using Key-n-Stroke as it is the only still supported one I found that is easily turned off/on when typing sensitive content like passwords:

Read the rest of this entry »

Posted in .NET, Development, Keyboards and Keyboard Shortcuts, KVM keyboard/video/mouse, Power User, PowerToys, Software Development, vscode Visual Studio Code, Windows | Tagged: , | Leave a Comment »

Alan Turing Wrote Object-Oriented Code In C And Ran It On BEAM – De Programmatica Ipsum

Posted by jpluimers on 2025/07/16

I originally missed this as back then I was in the midst of managing trouble in my parental family, unaware I was already having rectum cancer. Then things went fast, not even including the Covid-19 years, so I was glad last year I got reminded of this mid-2019 article:

[Wayback/Archive] Alan Turing Wrote Object-Oriented Code In C And Ran It On BEAM – De Programmatica Ipsum writes a lot of interesting things on programming paradigms, starting with

In his rare 1994 book “Object-Oriented Programming In C” Axel Tobias Schreiner explains how to do inheritance, class methods, class hierarchies, and even how to raise exceptions using nothing else than pure, simple, pointer arithmetic-filled, ANSI C.

then arguing basically most of not all modern languages share the majority of programming paradigms and all these paradigms are repeats of the past:

These days, we are using the offsprings of multiple programming paradigms having unprotected sex with one another in a thoughtful orgy. PHP, C#, Perl, C++ and even Visual Basic have all closures, lambdas or anonymous functions now. F# and Scala can instantiate any class included in their corresponding vendor-provided frameworks. JavaScript implements functions as objects with a single method .call(). Haskell comonads are actually objects. Swift 1.0 implemented instance methods as curried functions.
But none of this is new. Smalltalk, arguably the precursor of object orientation, had collect and select methods which were the grandparents of our more common map and filter functional friends.

What sets modern languages apart is that they the majority covers all the paradigms you might need, just differing in how well they support the paradigm-du-jour.

It means programming language wars should have been a thing of the past for about two decades now.

Please let that sink in.

 

Oh: if you look for that ANSI C book, here it is: [Wayback/Archive] https://www.cs.rit.edu/~ats/books/ooc.pdf [Wayback PDF View/PDF View]

 

Via: [Wayback/Archive] De Programmatica Ipsum: “”In his rare 1994 book “Object…” – mas.to

--jeroen

Posted in .NET, C, C#, C++, Cloud, COBOL, Containers, Design Patterns, Development, Docker, Erlang, F#, Go (golang), Haskell, Infrastructure, Java, Java Platform, Kotlin, Kubernetes (k8n), ObjectiveC, OOP (Object Oriented Programming), Perl, Scala, Scripting, Software Development, Swift, VB.NET | Leave a Comment »

badamczewski/PowerUp: ⚡ Decompilation Tools and High Productivity Utilities ⚡

Posted by jpluimers on 2025/07/10

Below is a really cool tool-set for Visual Studio Code of which its development started when I was recovering from life-saving bowel-surgery during the series of procedures to get rid of my metastasised rectum cancer.

It supports decompilation of various languages (.NET C# and F#, GO, Rust and clang) into either x86 assembler or IR (Intermediate Representation, on the .NET side often also called IL for Intermediate Language) to research how well a compiler stack behaves.

[Wayback/Archive] badamczewski/PowerUp: ⚡ Decompilation Tools and High Productivity Utilities ⚡:

Read the rest of this entry »

Posted in .NET, C#, C++, Development, F#, Go (golang), Rust, Software Development | Leave a Comment »

“C# emits .callvirt instructions, even if the method isn’t virtual. That forces a call site null check.” (Immo Landwerth on Twitter)

Posted by jpluimers on 2025/06/25

From a while back, which I initially missed because it was in the midst figuring out my ver increasing bowel problems leading up to all my cancer treatments, but still relevant:

[Wayback/Archive] Immo Landwerth @terrajobst@hachyderm.io on Twitter: “That’s why C# emits .callvirt instructions, even if the method isn’t virtual. That forces a call site null check.”

Except inside [Wayback/Archive] Extension Methods, referring to this will never return null.

Yes you can work around this using things like reflection, but the C# compiler will emit .callvirt for any method call which does an implicit null check by the caller which means you never have to check that in callees.

The above tweet quoted the first message of the [Wayback/Archive] Thread by @MStrehovsky on Thread Reader App on working around this .callvirt protection:

Read the rest of this entry »

Posted in .NET, C#, Conference Topics, Conferences, Development, Event, Software Development | Leave a Comment »

Naming things isn’t hard: if it contains a number, include the unit in the name (your timeout might not be in nanoseconds)

Posted by jpluimers on 2025/05/27

This case, it was C# accessing a SQL back-end, but the responses to the Tweet how so many more examples not even related to software development.

Remember that plane crashing because they overloaded while they thought the fuel load numbers were in Imperial pounds where in fact they were in metric kilograms?

That’s why naming things that contain numbers should contain the unit in their name!

Related blog post: Watch “Felienne Hermans: How patterns in variable names can make code easier to read” on YouTube

Tweet: [Wayback/Archive] Nick Craver on Twitter: “Troubleshooting a hanging test suite and godDAMMIT. “In seconds”. Integer timeouts should be a felony offense punishable by an indeterminate amount of seconds/milliseconds/hours/fortnights/whatever the judge chooses.”

var csb = new SqlConnectionStringBuilder(TestConfig.Current. SQLServerConnectionString){ ConnectTimeout = 2000 }; int SqlConnectionStringBuilder.ConnectTimeout { get; set; } Gets or sets the length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. Returns: The value of the SqlConnectionStringBuilder, ConnectTimeout property, or 15 seconds if no value has been supplied.

var csb = new SqlConnectionStringBuilder(TestConfig.Current. SQLServerConnectionString) { ConnectTimeout = 2000 }; int SqlConnectionStringBuilder.ConnectTimeout { get; set; } Gets or sets the length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. Returns: The value of the SqlConnectionStringBuilder, ConnectTimeout property, or 15 seconds if no value has been supplied.

Read the rest of this entry »

Posted in .NET, Agile, C#, Code Quality, Conference Topics, Conferences, Database Development, Development, Event, Software Development, SQL, SQL Server, Systems Architecture | Leave a Comment »

Online .NET source code browsers for both .NET Framework and .NET Core

Posted by jpluimers on 2025/05/22

I used these .NET Source Browsers quite few times over the last decade, first for the .NET Framework and later for .NET Core (now called .NET, sometimes .NET Runtime) as well, but forgot to blog about them, so now that I discovered there is one for the Roslyn Compiler Platform as well, let’s list them all:

It was introduced as [Wayback/Archive] referencesource-beta.microsoft.com by [Wayback/Archive] A new look for .NET Reference Source – .NET Blog which explains how to use it for browsing (on-line and off-line), Visual Studio integration, debugging, and more. In about a month however it got out of beta and became the primary as it functioned so well (you can verify this while browsing through the 2014 Wayback links).

All are powered by [Wayback/Archive] KirillOsenkov/SourceBrowser:

Read the rest of this entry »

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

Podcast with @mattgodbolt of godbolt.org fame, on among other things becoming a verb, 6502s, exploring compilers, and application binary interfaces.

Posted by jpluimers on 2025/05/21

From a while ago: [Wayback/Archive] Kristian Köhntopp on Twitter: “embedded.fm/episodes/334 Embedded.fm  with @mattgodbolt of godbolt.org  fame, on among other things becoming a verb, 6502s, exploring compilers, and application binary interfaces.”

Read the rest of this entry »

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

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 »

Delphi “array of const” to “varargs” – Stack Overflow

Posted by jpluimers on 2025/04/16

Just in case I ever think “oh, I might try want to go the Variadic function arguments way in Delphi” again, I must remember “maybe not a good idea” and re-read these posts:

Note that this example, despite the description indicates it is, it is actually not varargs by array of const (which requires using TVarRec as under the hood it is an open array of TVarRec): [Wayback/Archive] How to create functions that can accept variable number of parameters such as Format().

Then some Free Pascal links, which is different from, but also similar to Delphi:

Queries:

--jeroen

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