From: "krusty.ar@..." Date: 2008-07-02T04:27:14+09:00 Subject: Re: nested methods good or bad design On Jun 30, 12:42 pm, John Maclean wrote: > =begin > Hey chaps, > > Is it bad practice to have nested methods? I'm sure that it would > result in messey/cluttered code. Does any one actually code like that > at all? Not really -essential- as everything is working, (even better > than), as expected without nested methods. Just would be nice to know > what the gurus andmy peers think on this one. > I'm not sure I understand completely, but how is having a variable (or any other object) laying around representing that the system can call method2 is cleaner than: def method1 if criteria def method 2 ##... end end end ? I find that easier to follow than: def method1 if criteria #set some flag end end ##.. more code ##check the flag def method2 ##... end The only way that the first alternative could get messy is with very long methods, wich you should avoid anyway. Lucas.