Really the first example makes it difficult to understand but the article was very good. Congrats!
DRY principle serves to prevent you from copy/pasting code all around, to reduce code base, and for easier maintenance. I think that the first example is not a really good example of the DRY principle. The other one is totally fine.
Olivia Parker
A great developer is all about getting ahead of everything, minimizing mistakes to achieve efficiency. This tactic promotes easier coding maintenance, which saves a lot of time. Will share this with my fellow developers. Wonderful tip!
Olivia parker, IT BPO OBP IT Solutions