Skip to content

Commit

Permalink
Merge pull request #12 from coinbase/wilson/named-arguments
Browse files Browse the repository at this point in the history
Add prefer named arguments
  • Loading branch information
wilsoncusack authored Apr 13, 2024
2 parents 70b9645 + c7614c3 commit de9ea6a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,22 @@ For example

ASCII art is permitted in the space between the end of the Pragmas and the beginning of the imports.

#### 13. Prefer named arguments.

Passing arguments to functions, events, and errors with explicit naming is helpful for clarity, especially when the name of the variable passed does not match the parameter name.

NO:

```
pow(x, y, v)
```

YES:

```
pow({base: x, exponent: y, scalar: v})
```

## 2. Development

### A. Use [Forge](https://github.com/foundry-rs/foundry/tree/master/crates/forge) for testing and dependency management.
Expand Down

0 comments on commit de9ea6a

Please sign in to comment.