C#でメソッドの「オプション引数(省略可能な引数)」を定義するとき、記述が長くなってモヤモヤしたことはありませんか? 特に、DateTime や CancellationToken のような構造体を引数にする場合。 「値が渡されなかったら既定値にしたい」だけなのに、以前の ...
A monthly overview of things you need to know as an architect or aspiring architect. Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with ...
Anonymous functions were introduced in the C# programming language long ago. Although anonymous functions have many benefits, they are not cheap. Avoiding unnecessary allocations matters, and this is ...
クラスを設計していると、**「このメソッド内でしか使わない、ちょっとした処理」**をメソッド化したくなることがありますよね。 「長すぎるから分割したい」 「同じ計算を3回やるからまとめたい」 そう思って private メソッドとして切り出すと、今度は ...