Which of the following query is better... This is just an example, there are numerous situations, where I want the user name to be displayed instead of UserID
Scalar UDFs are very slow, but the inline ones are much faster, typically as fast as joins and subqueries
BTW, you query with function calls is equivalent to an outer join, not to an inner one.