Summary
This chapter discussed the details of declaring and calling methods, including the use of the keywords out and ref to pass and return variables rather than their values. In addition to method declaration, this chapter introduced exception handling.
A method is a fundamental construct that is a key to writing readable code. Instead of writing large methods with lots of statements, you should use methods to create “paragraphs” of roughly 10 or fewer statements within your code. The process of breaking large functions into smaller pieces is one of the ways you can refactor your code to make it more readable and maintainable.
The next chapter considers the class construct and describes how it encapsulates methods (behavior) and fields (data) into a single unit.