mercredi 23 décembre 2020

Is it a good practice to avoid long line on the return statement?

For example, suppose I have this function:

    private int Example()
    {
        return something.ExecuteSomething<Type>(ClassName.MethodName("param", false)).Count();
    }

Is it better to write it like that?

    private int Example()
    {
        var count = something.ExecuteSomething<Type>(ClassName.MethodName("param", false)).Count();
        return count;
    }

Aucun commentaire:

Enregistrer un commentaire