From d54a624e6ca469cc4847205d4a53e4c24a61e10e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 18 Aug 2024 12:06:07 +0100 Subject: [PATCH] Add daily email for 2024-08-16 What are err, req and res? --- source/_daily_emails/2024-08-15.md | 2 +- source/_daily_emails/2024-08-16.md | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 source/_daily_emails/2024-08-16.md diff --git a/source/_daily_emails/2024-08-15.md b/source/_daily_emails/2024-08-15.md index 36d5f5dd..c29cbaa3 100644 --- a/source/_daily_emails/2024-08-15.md +++ b/source/_daily_emails/2024-08-15.md @@ -11,7 +11,7 @@ snippet: | Docblocks or annotations. Which do you prefer? --- -As #Drupal 11 uses #PHPUnit 10, we can now use the `#[Test]` attribute instead of the `/** @test */` annotation. +As Drupal 11 uses PHPUnit 10, we can now use the `#[Test]` attribute instead of the `/** @test */` annotation for our test methods. For example: diff --git a/source/_daily_emails/2024-08-16.md b/source/_daily_emails/2024-08-16.md new file mode 100644 index 00000000..be0b65f4 --- /dev/null +++ b/source/_daily_emails/2024-08-16.md @@ -0,0 +1,25 @@ +--- +title: What are err, req and res? +date: 2024-08-16 +permalink: daily/2024/08/16/what-are-err--req-and-res +tags: + - software-development + - clean-code +cta: ~ +snippet: | + What are err, req and res? +--- + +Today, I was at another School of Code hackathon event, mentoring a team of three Developers as they planned and built an application within a day. + +During the day, we looked at some example documentation that included variable names like `err`, `req`, and `res`. + +I don't like short variable names like this. + +I'd suggest calling them what they are - `error`, `request` and `response`. + +This makes the code clearer and easier to read and understand, particularly if you aren't using types and need additional context. + +Readability is important as [people read more code than they write][0]. + +[0]: {{site.url}}/daily/2024/08/07/people-read-more-code-than-they-write