Named Arguments can make your code more clear

suggest change

Consider this simple class:

class SmsUtil
    public bool SendMessage(string from, string to, string message, int retryCount, object attachment)
         // Some code

Before C# 3.0 it was:

var result = SmsUtil.SendMessage("Mehran", "Maryam", "Hello there!", 12, null);

you can make this method call even more clear with named arguments:

var result = SmsUtil.SendMessage(
    from: "Mehran",
    to:  "Maryam",
    message "Hello there!",
    retryCount: 12,
    attachment: null);

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents