From: Robert Klemme Date: 2004-08-21T23:50:51+09:00 Subject: Re: This naughty language of ours violates hallowed Structure Programming sophistries "Phlip" schrieb im Newsbeitrag news:gDHVc.2566$C73.2434@newssvr31.news.prodigy.com... > Ruby supports Structure Programming much more subtly than by decrying goto. > When a goto leaps a tall procedure in a single bound, the root problem is > that tall procedure itself. Ruby's syntax maximizes opportunities to > minimize code. The style guideline "don't goto" is subservient to the > Simplicity Principle "Minimize Statements, Methods, and Classes". > > For example: > > def newThing() > klass = if something() then TkcLine else TkcPolygon end > element = constructor( klass ) > element.configure('smooth', '1') > end I'm not sure what you want to show with this, but if you want to minimize code there are other solutions: def new_thing thing = ( something() ? TkcLine : TkcPolygon ).new thing.configure('smooth', '1') thing end Note that your method relies on the implementation of #configure to yield the proper return value. IMHO that's bad practice since this requires more of #configure than necessary. Regards robert