February 2024
Beginner to intermediate
468 pages
11h 10m
English
In this chapter, we’re going to look at one of the basic principles of software development and learn how to apply it to save ourselves effort and make our code easier to maintain: Don’t Repeat Yourself, also known as the DRY principle. In The Pragmatic Programmer, by Andy Hunt and Dave Thomas, the principle is stated as “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.” Some programmers will take this principle to its logical conclusion and have no repeating code anywhere. We’re writing scripts, and so we will apply the principle just as much as is convenient. We will talk about the concept of functions within code. By the end of the ...
Read now
Unlock full access