From 1ccde94cbde5a8a6b0881836ddab459d9913bfa8 Mon Sep 17 00:00:00 2001 From: Wilson Cusack Date: Fri, 12 Apr 2024 11:12:35 -0400 Subject: [PATCH] Add prefer named arguments --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index aa24937..87ac648 100644 --- a/README.md +++ b/README.md @@ -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.