From 66a0d8cd0bf35caba28c5cb2eaacf046c8a8fd5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Guilherme=20Ferreira?= <56452762+lguilhermef@users.noreply.github.com> Date: Sun, 17 Apr 2022 16:02:19 +0100 Subject: [PATCH] Updated README.md to improve readability (#53) At Functions should do one thing, the function emailClients is only emailing activeClients, thus the suggestion to make its name explicit for reliability purposes. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c138b9c..b1a913f 100644 --- a/README.md +++ b/README.md @@ -372,7 +372,7 @@ This is by far the most important rule in software engineering. When functions d **Bad:** ```ts -function emailClients(clients: Client[]) { +function emailActiveClients(clients: Client[]) { clients.forEach((client) => { const clientRecord = database.lookup(client); if (clientRecord.isActive()) { @@ -385,7 +385,7 @@ function emailClients(clients: Client[]) { **Good:** ```ts -function emailClients(clients: Client[]) { +function emailActiveClients(clients: Client[]) { clients.filter(isActiveClient).forEach(email); }