Hi,<br><br>Of these 2 styles, which one is preferred, and why ?<br>To me, the readability of 2nd style is better, tough it consumes 1 stack frame extra.<br>Are there some cases where style-1 might be preferred, or be the only option ?<br>
<br><span style="font-family: courier new,monospace;">%% style-1 -----------------------------------------</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">mainLoop(InitialRun) -></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if InitialRun == true -></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> % do some initialization,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> mainLoop(false);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> true -></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> % do routine loop tasks,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> mainLoop(InitialRun)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> end.</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">%% style-2 -----------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">loopInit() -></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> % do some intialization,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> mainLoop().</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">mainLoop() -></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> % do routing loop tasks,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> mainLoop().</span><br><br><br>cheers,<br>
Icarus