10 Antipatterns

This chapter covers

  • Discussing programming antipatterns
  • Reviewing common antipatterns in Rust
  • Recognizing when to use and when to avoid contentious patterns

Antipatterns are programming practices that are considered harmful in specific contexts or all circumstances. Antipatterns are often the result of a misunderstanding of languages or a lack of experience with a particular technology stack. In this chapter, we’ll discuss some common antipatterns in Rust and how to avoid them.

First, we must discuss what constitutes an antipattern and then explore Rust’s most common examples. We’ll also discuss when to use—and when to avoid—specific patterns and when to make exceptions.

The rules presented in this chapter aren’t hard-and-fast ...

Get Idiomatic Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.