This is a pretty common technique in JavaScript but I want to make sure I can do this in C#.
I'm in function DoSomething()
and during the execution of a call, I need to call the same function with a different value. See below:
public bool DoSomething(int id)
{
if(id < 100)
{
// Some logic here
var someValue = id + 50;
var outcome = DoSomething(someValue);
// Some more logic here
}
else
{
// Some other logic here
}
}
I see no reason why I couldn't do the above but want to see if this is a bad practice in C#.