In this chapter, you will learn elements of the Julia language that are important when creating larger projects. We start with exploring Julia’s type system. Understanding how type hierarchy works is essential to learning how to define multiple methods for a single function, a topic we started discussing in section 2.4. Similarly, when you use an existing function, you must know how to find out which types of arguments it accepts. Getting an exception because you tried to pass an argument of incorrect type when calling a function is one of the most common errors when working in Julia. To avoid such problems, you must have a good understanding of how Julia’s type system is designed.
When you define methods for a function, you can restrict the types of arguments they accept. This feature makes your Julia programs faster, allows you to catch bugs more easily, and makes it easier to understand how the code works.