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

Archive for the ‘C#’ Category

Value types not having parameterless constructors…

Posted by jpluimers on 2019/03/27

The list below is based on a G+ discussion in a single language, but has way broader aspects.

It’s on value types, mutability, parameterless constructors and expectations of compiled code.

I’ve bitten myself in the foot with mutable types in too many languages too often, so I started advocating this years ago at clients, and now in this blog-post.

TL;DR:

  • some languages disallow parameterless constructors: C++, C# and Delphi are examples
  • this historically stems from the C++ and C# background
  • it has to do with them not wanting to automatically call them upon array initialisation taking a lot of CPU time
  • most languages do not stop you from making mutable value types, but in practice your value types should be immutable as otherwise you will open a can of worms, for instance you will have a hard time:
    • preventing threading issues
    • making code following functional patterns
    • scaling your code by making your algorithms supporting parallel execution
  • parameterless constructors include constructors with parameters having default values

Some links that explain this in more depth:

The “just pass them as reference” often seen as reason to explain “mutable value types are OK” is exactly describing why they are not OK.

–jeroen

Posted in .NET, C#, C++, Delphi, Development, Software Development | 2 Comments »

Image recognition with C# and Emgu libraries: a .NET wrapper around Intel OpenCV – CodeProject

Posted by jpluimers on 2019/03/26

Cool article for doing image stuff from within C#: [Archive.isImage recognition with C# and Emgu libraries – CodeProject

–jeroen

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

Tips and Tricks in the Visual Studio Debugger | Microsoft Docs

Posted by jpluimers on 2019/01/30

A few things in there that I didn’t know yet (like pinning data tips, tracking out-of-scope variables with object-ID and debugger attachment): [WayBackTips and Tricks in the Visual Studio Debugger | Microsoft Docs.

Via: [WayBackUsing the debugger in #VisualStudio? Learn how to pin #data tips, change the execution flow, & more w/ these tips & tricks: http://msft.social/wbmUes – Lars Fosdal – Google+

–jeroen

 

–jeroen

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

Convert Indesign Sketch to code: Petra Sketch Plugin | Melbourne | Applying Code

Posted by jpluimers on 2019/01/22

Interesting code generator from 3D models into Xamarin, Delphi or Oxygene code:

[WayBack] Petra Sketch Plugin | Melbourne | Applying Code

Convert Sketch drawings to iOS, macOS, Android a​nd​ Windows native drawing code.

[WayBack] Documentation of Petra Sketch Plugin | Melbourne | Applying Code

Via:

–jeroen

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

from a WSDL import: empty “Reference.cs” – Google Search

Posted by jpluimers on 2019/01/10

A search for empty “Reference.cs” – Google Search seems to indicate this happens with referenced types that – despite turning off that option – from the Visual Studio 2017 IDE sometimes results in an empty Reference.cs.

My solution: import in an empty project, then move the reference to the existing project and add it.

[WayBack] c# – Sometimes adding a WCF Service Reference generates an empty reference.cs – Stack Overflow

–jeroen

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

 
%d bloggers like this: