From: gabriele renzi Date: 2005-01-30T10:15:49+09:00 Subject: Re: Ten Things Every Java Programmer Should Know About Ruby Navindra Umanee ha scritto: > Florian Gross wrote: > >>Not having your Objects changing types all the time without you >>noticing. If you forget to initialize a field in PHP it will be >>converted to zero or an empty String if necessary thus shadowing your >>bug. Strong typing usually is a requirement for languages where OOP >>works well. > > > In Ruby, objects pass for different types all the time. In my own > recent Ruby code I've mistakenly passed in the wrong types but didn't > notice because the types responded to the same methods. > > Even though the type didn't change, effectively the problem and bug > shadowing was identical to the case you describe. not quite the same. compare: method sum(a,b) return a+b strongly typed language: a='yo' b=2 sum(a,b) #error weak typed: a='yo' b=2 method sum(a,b) # 2 with 'yo' converted to 0? "yo2" with 2 stringified? the former has much less potential to hide an error.