Skip to content

Commit

Permalink
Add section on limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Jan 13, 2024
1 parent f4cb43a commit 0c2de1f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions projects/interfaces/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ Implement functions on `OurByteBuffer` so that all the tests pass.

(Hint: We need to implement our functions on _pointers_ to `OurByteBuffer`, not to _copies_ of it).

#### Limitations

When implementing a type we're going to use in different places, it's important to think about the limitations of our type.

Some examples of limitations for `OurByteBuffer` may be:
- Is there a maximum about of data an `OurByteBuffer` can store?
- What operations are safe or unsafe to perform concurrently on an `OurByteBuffer` from different threads?
- Are there any important performance characteristics? e.g. is it much faster or slower to `Write` one large amount of data to it than write the same amount of data one byte at a time?
- Are there any important memory characteristics? e.g. does an `OurByteBuffer` always retain all data that was stored in it, or does it free some of its memory after it's been read?

It can be useful to note these limitations in a doc comment for the type, or method, they apply to. This will help someone using your type to use it the best way. Make sure you write these docs.

When you need to pick (or implement) a type which implements an interface, it's important to think about these limitations.

### Implementing a custom filter

Implement a new struct called `FilteringPipe`.
Expand Down

0 comments on commit 0c2de1f

Please sign in to comment.