Wrapping Up

Modules enable you to organize your code with namespaces and make it easy to provide a single source of common functionality across classes. As your projects get bigger, you’ll move from finding them useful to finding them necessary. Always use a module to envelop your project. Extract related method functionality to a module so that you can include and reuse it in many classes. Take some time to get acquainted with the modules that come with the standard library, both so you can reuse them and so you can model your own module use on their practice.

We’ll apply this immediately in the following chapter, using the tools Crystal provides to generate and manage projects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.101.81