From: Logan Capaldo Date: 2006-03-14T05:29:54+09:00 Subject: Re: abstract method in Ruby --Apple-Mail-3-765818685 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Mar 13, 2006, at 2:21 PM, ara.t.howard@noaa.gov wrote: > you are perfectly correct. however, i think we all know that there > is a lot > of code, especially in-house, where the docs are pretty thin. in > my case > keeping 30,000 lines of ruby documented makes no sense since > > - i'm the only developer > > - we do research and the code changes daily > > - it's less work to use long variable names and abstract code at > every > possible opportunity into stand-alone libs than to write docs. What's the big difference between # abstract method foo and abstract_method :foo ? This is what's boggling my mind. It's not writing some documentation, its writing it in the same place you'd call your abstract_method method anyway. And you can still search for it within vim or whatever. I don't know enough about your particular case for "native_int_atrribute" but tyou're probably talkign to some library that expects an int and that method probably does some checking on assignment, which is fine. That makes sense. What I'm suggesting is that although a program should explode immediately when there's a problem, it also shouldn't explode when there isn't one. If I never call map, each will never be called, so its ok if I don't implement it. Then on the day I do call it, and run it for the first time, it expldoes right there, when I'm calling each. I know immediately what change I _just_ made caused it to explode. OTOH if I mixin Enumerable w/o an each, and each is an "abstract_method" it breaks whether I use it or not. But when everbody starts using abstract methods, all of a sudden I'm back in the land of compile-fix, compile-fix. Cause that error is gonna happen right away, so I have to deal with that immediate error. Then I can run it again to make sure it works, but now the error happens again, compile-fix ad infinitum. --Apple-Mail-3-765818685--