# Difference between a normal function and coroutine without yeilding anything

I just came across a coroutine in my project, which does few calculation, which could have been done using normal function.There is no loop in that coroutine and contains yield return null; in the last line. Is there any specific reason to use coroutine rather than normal function?

void Init(){
RenderObject();

}

IEnumerator Init(){
RenderObject();
yield return null;
}


EDIT:

Inside the RenderObject function, they are calling another coroutine which has two yield instructions yield return true; and yield return new WaitUntil(() => based on certain condition, calling to server takes place primarily.

• In this case - no. – joltmode Jun 15 '17 at 12:01
• I can't find any case where this has a useful outcome. Can you maybe show more context around how it's used, just in case we're overlooking something? At this point, my best bet is that the method used to need to do something the frame after RenderObject(), but that got refactored out, leaving the bottom part of the method empty. Or the developer was anticipating they'd need a longer-running multi-frame coroutine here in future, so they stubbed in the method as a coroutine and added a yield somewhere harmless (if puzzling) so the compiler wouldn't generate an error. – DMGregory Jun 15 '17 at 12:24
• @DMGregory Inside the function, they are calling another coroutine which has two yield instructions yield return true; and yield return new WaitUntil(() =>  based on certain condition, calling to server takes place primarily. – MrRobot9 Jun 15 '17 at 13:07
• To add more detail to your question, please use the edit button. That way all the information is in one place, and folks don't have to follow a whole comment threat to piece-together the situation. You also get better tools for code formatting that way. :) – DMGregory Jun 15 '17 at 13:09