mstdn.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A general-purpose Mastodon server with a 500 character limit. All languages are welcome.

Administered by:

Server stats:

16K
active users

TIL (meaning, Tonight I Learned) that you can declare non-optional parameters after optional ones in C#.

Just create an indexer with optional parameters:

int this[int a, string b = "b"] { get; set; }

The IL for the set method is this:

instance void set_Item (
int32 a,
[opt] string b,
int32 'value'
) cil managed
{
.param [2] = "b"
}

Note that the "value" is after b.

Jason Bock

And OH BOY does this matter when you're doing code gen, reading the method signature in Roslyn, and you realize you can't follow the method parameter order verbatim.