From: Hal Fulton Date: 2005-05-05T03:20:28+09:00 Subject: Re: Typo-checking instead of static typing Joe Van Dyk wrote: > On 5/4/05, Jon A. Lambert wrote: > >>Ben Giddings wrote: >> >>>Static typing tends to find typos and brainos in code before it's >>>executed. >>> >> >>My most frequent Ruby error: >>"NoMethodError: undefined method `foo' for nil:NilClass" >> >>Not a typo, and arguably anything is a braino. >> >>Fixed by asking oneself two questions >>1) How in sam hill did that get set to nil? >>2) Can method bar can return nil, if blah blah foozle wimble? >> > > > That's about my most common error too (it ties with a parse error due > to a missing 'end' statement). > Yes. Most languages just shift this "boundary problem" into different paradigms and terminology. In Java, the "pointerless language," the most common runtime error is "NULL pointer exception." Or in Pascal, "Attempt to dereference nil pointer." Or in C, "Segmentation fault." Hal