Content deleted Content added
→Example: format code |
m Task 18 (cosmetic): eval 5 templates: hyphenate params (4×); |
||
Line 18:
In most object-oriented languages, such as [[Java (programming language)|Java]] or [[C Sharp (programming language)|C#]], [[Reference (computer science)|references]] may be [[Null pointer|null]]. These references need to be checked to ensure they are not null before invoking any [[Method (computer science)|methods]], because methods typically cannot be invoked on null references.
The [[Objective-C|Objective-C language]] takes another approach to this problem and does nothing when sending a message to <code>nil</code>; if a return value is expected, <code>nil</code> (for objects), 0 (for numeric values), <code>NO</code> (for <code>BOOL</code> values), or a struct (for struct types) with all its members initialised to <code>null</code>/0/<code>NO</code>/zero-initialised struct is returned.<ref>{{Cite web|url = https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithObjects/WorkingwithObjects.html#//apple_ref/doc/uid/TP40011210-CH4-SW22|title = Working with Objects (Working with nil)|date = 2012-12-13|
== Description ==
Line 75:
| first = Martin
| last = Fowler
|
| year = 1999
| title = Refactoring. Improving the Design of Existing Code
Line 85:
| first = Joshua
| last = Kerievsky
|
| year = 2004
| title = Refactoring To Patterns
Line 95:
| first = Robert
| last = Martin
|
| year = 2002
| title = Agile Software Development: Principles, Patterns and Practices
|