From 1ccde94cbde5a8a6b0881836ddab459d9913bfa8 Mon Sep 17 00:00:00 2001 From: Wilson Cusack Date: Fri, 12 Apr 2024 11:12:35 -0400 Subject: [PATCH 1/2] 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. From c7614c3b50a8dca5ce0f27320c4983bc1bf182cb Mon Sep 17 00:00:00 2001 From: Wilson Cusack Date: Fri, 12 Apr 2024 11:15:06 -0400 Subject: [PATCH 2/2] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87ac648..b2c34d4 100644 --- a/README.md +++ b/README.md @@ -226,7 +226,7 @@ pow(x, y, v) YES: ``` -pow({base: x, exponent: y, scalar: v) +pow({base: x, exponent: y, scalar: v}) ``` ## 2. Development