Null Pattern revisited
Yesterday I have rewritten 3600 LOC codebase in ActionScript as if there were “message eating” null in the core and the standard libraries (please see A Generalized Null Object Pattern by Nevin Pratt). I got a diff with just 100 lines removed and 180 lines updated. It is at most 7% code reduction.
It seems that “message eating” null neither produces considerably more elegant code, nor considerably more brittle code (in all cases ignoring null value is correct).
In sense of VM implementation, it might be easier to implement a classical “exception raising” null and use custom Null Pattern classes where appropriate.
