From: Minkoo Seo Date: 2006-05-07T17:36:19+09:00 Subject: Re: A major ruby annoyance! ------=_Part_173_7733905.1146990976422 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline In my case, I use -w always, and try to depend on autocompletion feature available in vim. (^P, ^N, ^XO) Other than that, AFAIK, there are no alternatives in the language which doesn't have variable declaration feature. Thought Ruby has syntax check facility, "ruby -wc", it does not find typos. It just check syntactic errors. Sincerely, Minkoo Seo On 5/7/06, Talha Oktay wrote: > > I am a newbie in Ruby. I have read several books including pickaxe and > wrote > several thousands lines of code. So far, as an ex perl user, I have found > the major annoyance with ruby is the lack of declaration of variables. > Automatic creation, in perl jargon autovification is the common feature > of > many high level languages such as perl, paython, visual basic etc. but > most > of the these languages have seen that this not necessarily a good thing > and > created flags, commands to prohibit it if the developer wants to. I reall= y > wish ruby had one. Last several hours I spent debugging a > malfunctioning > code just to see mistyped variable name was causing all the problem. I ha= d > to put many log statements which polluted to the code. > > I guess in Pickaxe book, unit testing is presented as the cure for this > problem which I do not agree. I can not write a test code for every peace > of > little functionality, besides I am eager to make the compiler or > interpreter > to work for me. Why not tell the interpreter to check the code, instead o= f > writing very detailed test programs. I am not a very good typist and I > often > mistype variable names, often I had to depend on vim's auto completion > feature. But I do not want to depend to an editor or an IDE for this. > > I have also found the ruby's -w flag does not work as I perl -w flag does= . > In perl warnings are really descriptive. You can even use a module calle= d > diagnostics which almost teaches to fix the problem that crashes program > or > generates warning etc. I often do not use -w as because I receive warning= s > from libraries that my code includes or warnings I do not understand at > all. > > May be I am the only one who is bothered with these. I do not know. > > ------=_Part_173_7733905.1146990976422--