News for hackers. Stuff that matters.
Re:Get to No as fast as possible by fleitz on Thursday June 17, 2010 @04:59PM (#1440325)
It's generally pretty easy to do if you write your code in a functional/tail recursive style. Instead of modifying your variables and returning, create new variables and pass them back into your function, in that way whatever you create will have to go back through all the sanity checks. Yes you can get infinite loops this way, but it alerts you to having coded your function incorrectly instead of returning the wrong data.

func(condition,resp){ val = true if(!condition){ return func(!condition,'new'); }) return resp } func(false,'whatever');

There are no comments on this comment yet.