Skip to main content
Code Enthusiast

Code Enthusiast

Started from interest, guided by profession.

Prism
An IL dynamic weaving library.
Robotless
A robot software platform.
CSharp Initialization Sequence of Members

Initialization Sequence Within a Single Instance

Consider a part of CSharp code as follows, and try to guess what is the value of instance.Number:


var instance = new SampleClass()
{
    Number = 3;
};

Console.WriteLine(instance.Number); // What's the value of property 'Number'?

class SampleClass
{
    public int Number {get; set;} = 1;

    public SampleClass()
    {
        Number = 2; 
    }
}

Haoyu JiaOriginalAbout 2 minCSharpFundamentals
Useful Commands for Maintaining Docker Servers

Usually there will be containers and images which are no longer in use, yet their creators just forgot to remove them, left them to remain in servers as 'Status: Exited, Last Used: 3 Years Ago'. Unused containers will hold up their images, and every image of those no longer used old versions will hold up 3~5GB disk space.


Haoyu JiaOriginalAbout 1 minDockerServer Maintaince
Welcome to Code Enthusiast!

In this blog, I'll post some of my own reflections on software development or robotic software engineering to the Posts folder, and notes on what I've learned to the Notes folder.


Haoyu JiaOriginalLess than 1 minuteEnglish