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,616 other followers

Archive for the ‘C#’ Category

Cyclomatic Complexity of switch case statement – Stack Overflow

Posted by jpluimers on 2019/06/12

For my archive: [WayBack] Cyclomatic Complexity of switch case statement – Stack Overflow.

Ultimate reference: [WayBackNIST Special Publication 500-235: Structured Testing: A Testing Methodology Using the Cyclomatic Complexity Metric

Via: [WayBack] I have a question regarding Cyclometric Complexity… IF versus CASE… – David Hoyle – Google+

–jeroen

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

How to Design Early Returns in C++ (Based on Procedural Programming) – Fluent C++

Posted by jpluimers on 2019/05/15

One more thing to take away from Procedural Programming: It’s Back? It Never Went Away – Kevlin Henney [ACCU 2018] – YouTube was explained in [WayBack] How to Design Early Returns in C++ (Based on Procedural Programming) – Fluent C++.

Though in C++, it applies to all programming languages that stem from a procedural background (Pascal, C#, Java, golang, to name just a few).

The article is about keeping an if/else-if/else tree, even when they can be removed becomes some of their bodies perform an early return, as

In C++, as well as in other languages, the return keyword has two responsibilities:

  • interrupting control flow,
  • yielding a value.

It basically comes down to this argument:

Essentially, the argument for Code #1 is that you need to know less to understand the structure of the code.

Indeed, if we fold away the contents of the if statements, Code #1 becomes this:

The structure of the code is very clear. There are 4 different paths based on the year, they’re independent from each other, and each path will determine the boolean result of the function (if it doesn’t throw an exception).

Now let’s see how Code #2 looks like when we fold away the if statements:

And now we know much less. Do the if statements contain a return? Maybe.

Do they depend on each other? Potentially.

Do some of them rely on the last return false of the function? Can’t tell.

With Code #2, you need to look inside of the if statement to understand the structure of the function. For that reason, Code #1 requires a reader to know less to understand the structure. It gives away information more easily than Code #2.

–jeroen

via [WayBack] Kevlin Henney – Google+: How to Design Early Returns in C++ (Based on Procedural Programming) – Fluent C++

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

Should you convert your Visual Basic .NET project to C#? Why and why not… | Tim Anderson’s IT Writing

Posted by jpluimers on 2019/04/23

Since I get this question every now and then: [WayBackShould you convert your Visual Basic .NET project to C#? Why and why not… | Tim Anderson’s IT Writing.

Via [WayBack] Should you convert your Visual Basic .NET project to C#? Why and why not… https://www.itwriting.com/blog/11089-should-you-convert-your-visual-basic-net-… – Ondrej Kelle – Google+

–jeroen

Posted in .NET, C#, C# 6 (Roslyn), Development, Software Development, VB.NET | Leave a Comment »

Draft – .NET Glossary Diagram – Scott Hanselman

Posted by jpluimers on 2019/04/10

By now this should be out of [WayBackDraft – .NET Glossary Diagram – Scott Hanselman: a list of common terms to describe various parts of the .NET ecosystem.

He has a nice list of sentences where each term is used.

I’ll try to use them myself as well, so I gave it a start at paulcbetts/refit: The automatic type-safe REST library for Xamarin and .NET.

–jeroen

Posted in .NET, C#, Development, F#, Software Development, VB.NET, Visual Studio and tools | Leave a Comment »

paulcbetts/refit: The automatic type-safe REST library for Xamarin and .NET

Posted by jpluimers on 2019/04/03

This is so cool: [WayBack] paulcbetts/refit: The automatic type-safe REST library for Xamarin and .NET. It’s  inspired by Square’s [WayBack] Retrofit library which does the same for Java.

They basically allow you to use attributes on interfaces to define a type-safe wrapper around any REST interface, then instantiate a connection to it for making calls.

No more manual HttpClient fiddling!

Since it requires only .NET 1.4, you can basically run it on any platform as it’s supported covered by the implementations .NET Core, Mono and the full .NET Framework.

Quite a lot of projects already use it; I got there via the first link:

–jeroen

Via: [WayBack] Exploring refit, an automatic type-safe REST library for .NET Standard https://www.hanselman.com/blog/ExploringRefit… – Jeroen Wiert Pluimers – Google+

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

 
%d bloggers like this: