Anti-Patterns

Over the last five chapters, we have looked in great detail at reusability, performance, maintainability, safety, and some miscellaneous design patterns. These patterns are extremely useful and can be applied to various situations for different types of applications. While it is important to know what the best practices are, it is also beneficial to understand what pitfalls to avoid. To do this, we are going to cover several anti-patterns in this chapter.

Anti-patterns are bad practices that programmers may do unintentionally. Sometimes, these problems are not severe enough to cause trouble; however, it is possible that an application may become unstable or have degraded performance due to improper design. In this chapter, we will cover the following topics:

  • Piracy anti-pattern
  • Narrow argument types anti-pattern
  • Nonconcrete field types anti-pattern

By the end of this chapter, you will have learned how to avoid developing pirate functions. You will also be more conscious and smart about the level of abstraction when specifying the type of function arguments. Finally, you will be able to leverage more parametric types in your design for your own composite types for high-performance applications.

Let's start with the most interesting topic—piracy!

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

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