When going through view code generated by Grails I noticed heavy use of the question mark operator when referencing properties. After browsing around I discovered that it is called the ‘safe dereference operator’
Sounds more complex then it is, it just makes sure that consequent methodcalls are only executed when the object on which it is called actually exists:
In the case above the ‘email’ property will only get read when the ‘user’ object actually exists and the ‘encodeAsHTML()’ will only get called when the ‘email’ property actually has a value. Cool!