From: "Jan E." Date: 2012-09-26T18:35:24+09:00 Subject: Re: inject problem Roelof Wobben wrote in post #1077587: > I'm just beginning with ruby and in this moments I miss a IDE where I > can do everything step by step so I can see what went wrong. Well, I wouldn't rely too much on the IDE. The danger of this is that it leads to a kind of "trial and error" programming: You just write something down and then use the debugger to make actual working code out of it. That's not how it should be, especially when you've just started. The code reflects your thoughts, so it should at least be logical in itself. Sure, we all make mistakes, so there will always be typos, syntax errors etc. But when your code is logical incorrect, it shows that you've not really thought this through (or maybe didn't even understand the parts you've copied and pasted). This is no critique or something, just a suggestion. In school exams, we actually have to write down our code on a piece of paper. This way we focus on clear thoughts, not so much on getting the code running somehow. > Now refractor the if then 's and I hope I can decline it to less then 5 > if then's. I don't understand the logic, so I can't help you with that. But you should structure the cases with nested "if"s. -- Posted via http://www.ruby-forum.com/.