2 ms·
I knew it wouldn't be long before someone dismissed it as programmer error. But that's the whole promise of static typing — preventing programmer errors from ca
by kartickv 9y ago
I knew it wouldn't be long before someone dismissed it as programmer error. But that's the whole promise of static typing — preventing programmer errors from causing runtime crashes. In this case, static typing failed at its task.
- makecheck 9y agoNo. "Static typing" means that the runtime type is known at compile time, and it was known: it was presented as being either a valid object or nil. The behavior was consistent with the two possibilities that were "promised" by the compiler. When your program overrides with "!", you are disabling the language's protections. You really can't blame the type system for failing to complain about something that you told it not to check!