From: boris Date: 2002-02-04T00:32:32+09:00 Subject: Re: Variable types On Sun, Feb 03, 2002 at 11:35:17PM +0900, Dave Thomas muttered... : Chris "boris" Ross writes: : : > I am from the camp where variables should be declared - that way : > everyone knows what the score is :) : : In that case, welcome over to our camp :) Heh, I love ruby, I am merely saying what I personally like :) : I strongly believe that strong beliefs need challenging every now and : then. That doesn't mean that the beliefs are wrong. But how will you : know unless you try them? Oh, I'm open minded about alot of things, and I have played with a lot of other peoples code. It drive me nuts when I am trying to work out where variables that should be doing one thing, are doing something else, and I have to pick the code a part to trace it execution. I suppose it that that drives me to like variable declarations :) : I also believed strongly in typing and all the stuff that goes with : it. I would have argued against anyone who told be that variables : didn't need declaring. But after spending only a little time with : Ruby, I realized that its approach to variables is infinitely more : flexible (which makes refactoring, and hence keeping code tidy, a lot : easier). I also discovered to my surprise that the resulting code was : no less reliable that stuff where the variables were declared. Partly : that's due to the fact that in Ruby the test/code cycle is trivially : short, so you can typically test after writing a line or two of : code. Typos get caught early. This is also true, but the problem is that you assume that the programmer is good and wont hide away variable usage, declarations just make life easier as it shows a "it starts here". It's very easy to just pluck a variable out of thin air and start using it. : Anyway, that's my experience. Yours may be different. However, I'd : suggest that you probably want to spend a month or so using Ruby as it : comes, and then see what your experience tells you about changes : needed to the language. I'm not asking for changes at all :) If you want a glimspe at the sort of language I think is near to perfect to what I want, look at ferite :) It's all a matter of choice, style and origins - and falls back into the slot of "right tool for the job", for each person the tool is likely to be different. I know people that would swear blind at using c to do tasks where others would use perl, python, ruby etc. Regards, Chris -- +------------------------------------------------------------------+ | Chris Ross | chris@darkrock.co.uk | ctr@ferite.org | | | http://www.darkrock.co.uk | http://www.ferite.org | +------------------------------------------------------------------+ "I come from Alabama with a Tagline on my knee."