From 9ce230112799aa20cff890936d7670562ea9323d Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 23 Jan 2023 03:25:35 +0400 Subject: [PATCH] Update src/roadmaps/software-design-architecture/content/100-clean-code-principles/105-pure-functions.md --- .../100-clean-code-principles/105-pure-functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/roadmaps/software-design-architecture/content/100-clean-code-principles/105-pure-functions.md b/src/roadmaps/software-design-architecture/content/100-clean-code-principles/105-pure-functions.md index b9b5210b3..71bf18036 100644 --- a/src/roadmaps/software-design-architecture/content/100-clean-code-principles/105-pure-functions.md +++ b/src/roadmaps/software-design-architecture/content/100-clean-code-principles/105-pure-functions.md @@ -2,9 +2,9 @@ A pure function is a specific type of function that meets the following criteria: -1. It takes some input, known as arguments, and returns a value or output. -2. It does not cause any observable side effects, such as modifying the state of the system or interacting with external resources. -3. Given the same input, it will always return the same output. -4. It does not depend on any state or variables that are outside of its scope. +- It takes some input, known as arguments, and returns a value or output. +- It does not cause any observable side effects, such as modifying the state of the system or interacting with external resources. +- Given the same input, it will always return the same output. +- It does not depend on any state or variables that are outside of its scope. Pure functions are considered to be more predictable and easier to test, as their behavior is determined solely by the input they receive and their internal logic. They also make it easier to reason about the behavior of a program, since the output of a pure function is not affected by any external factors. Pure functions are often used in functional programming, where they are considered a key principle. They are also useful in concurrent and parallel programming, as they are less prone to race conditions and other concurrency-related issues. \ No newline at end of file