c# extensions


i typically progression methods unequivocally sparingly. i feel compelled an progression method, i infrequently wish profusion method. doubt is, your thoughts progression methods job progression methods? bad practice? feels wrong, nonetheless i can't unequivocally interpretation why.



for example, second caselessis slight calls first:



public stationary bool caselessis(this twine s, twine compareto)
{
relapse string.compare(s, compareto, true) == 0;
}

public stationary bool caselessis(this twine s, ienumerable<string> compareto)
{
foreach(string comparison compareto)
{
(s.caselessis(comparison))
{
relapse true;
}
}

relapse false;
}


would some-more suitable this? downside violates dry.



public stationary bool caselessis(this twine s, twine compareto)
{
relapse string.compare(s, compareto, true) == 0;
}

public stationary bool caselessis(this twine s, ienumerable<string> compareto)
{
foreach(string comparison compareto)
{
(string.compare(s, comparison, true) == 0)
{
relapse true;
}
}

relapse false;
}


Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

using mvc, should hoop communication between views? between models?