Introduction

Completed

As your programs grow, you'll start noticing the same logic showing up in more than one place. Copy-pasting that logic works for a while, but it quickly becomes hard to update, easy to break, and painful to read. Methods solve that problem by giving a name to a block of code and letting you reuse it anywhere.

In this module, you learn how to define methods, pass data to them with parameters, get results back with return values, and understand how variable scope keeps your code from stepping on itself. You also learn how namespaces and the using directive help you organize and reuse code.