From: Garthy D Date: 2013-02-16T16:23:00+09:00 Subject: Re: [from BASIC to Ruby] so, what's the proper way to replace funcionality of GOTO ? Hi all, On 16/02/13 11:16, Ryan Victory wrote: > Well, considering the OP's question was "What's the /proper/ way to > replace functionality of GOTO" (emphasis mine), I'd say that pretty much > any rubyist would agree that a goto like structure doesn't belong in > ruby code unless it truly is the most elegant solution (escaping > multiple nested loops for example). Not that it really matters either > way, this question has been answered by somebody else and I believe the > OP is satisfied. > > -Ryan I just wanted to say that I think Ryan is attempting to steer the OP in the right direction, which is to prefer modern, sensible structures where possible that don't have the numerous drawbacks that GOTO is saddled with. Reducing it to a car analogy, as all things do, ;) consider if someone familiar with driving an auto was asking how to make a manual move, and if you accelerated with the same pedal. Someone like Ryan steps in and very wisely says that you might want to figure out the clutch first, since the car isn't going anywhere without changing gears. Someone else points out that the clutch won't move the car at all, and that he is wrong. Sure, that's technically correct, he would be wrong, but the point is that the real problem that should be addressed involves understanding the role the clutch also plays. I also want to add that I *also* had absolutely *no* idea that Ruby had anything like GOTO and was similarly thrown (pun intended) by the mention of catch/throw. I've not had a need for it yet, myself. It's simultaneously disturbing, interesting, and scary to know this exists. ;) I started out software development around a couple of decades ago with BASIC, and then later assembly language, before moving on to Ada, C, and C++. Anyone with a similar background can imagine how much unlearning *that* required. ;) Ryan's advice is good, especially for someone in that position. Ryan, like me, just didn't know about Ruby catch/throw. It's still good advice. I just wanted to make sure at least one person has acknowledged this. Cheers, Garth