3 REFERENCE AND VALUE PARAMETERS
In this chapter, we’ll look at how method parameters and arguments relate to reference and value types. We’ll revisit the idea that all variables have a value, regardless of their type, and see how to pass values of different types by value or by reference as arguments for methods.
We’ll explore the following:
- How reference and by reference differ in meaning
- Why aliasing and mutability are so closely related
- How avoiding side effects can make our code clearer
- When to pass values by reference as an optimization
Passing method parameters by value or by reference isn’t the same as those parameters being value ...
Get The C# Type System now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.