From: E S Date: 2005-01-30T04:17:34+09:00 Subject: Re: Ten Things Every Java Programmer Should Know About Ruby > L�hett�j�: Navindra Umanee > Aihe: Re: Ten Things Every Java Programmer Should Know About Ruby > > PA wrote: > > > This looks more like Java than Ruby... I don't see your point. > > > > Sorry. Forgot to reboot in Ruby mode: > > > > aMethodExceptingToFlyABirdButGivenAPigInstead( aPig ) > > > > And what would happen to this mythical flying pig now? aPig.fly()? > > EXC_BAD_ACCESS (aka method_missing). > > Right. So aPig.fly() would work if method_missing() was defined or if > a method Pig.fly() happened to be defined as an alias for > Pig.eat_fly(). > > In Java, on the other hand, you would clearly get the advantage that > you seek here. On the other hand, the time you save by writing Ruby code instead can be used to write a unit test to ensure your logic is correct. There are tradeoffs to everything. > Cheers, > Navin. E