Skip to content

Commit

Permalink
limits -> disadvantages
Browse files Browse the repository at this point in the history
  • Loading branch information
damirka committed Jan 20, 2025
1 parent da3621d commit 0ddbfa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/src/programmability/newtype-pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ methods to the `Stack` type.
{{#include ../../../packages/samples/sources/programmability/newtype-pattern.move:common}}
```

## Benefits
## Advantages

The newtype pattern has several benefits:

- Allows defining custom functions for an existing type.
- Constrains function signatures to the newtype, thereby making the code more robust.
- Often increases the readability of the code by providing a more descriptive type name.

## Limitations
## Disadvantages

The newtype pattern is a very powerful pattern in two scenarios: when you want to limit the behavior
of an existing type and provide a custom interface to the same data structure, and when you want to
Expand Down

0 comments on commit 0ddbfa0

Please sign in to comment.