Hey everyone,
I’m a CS student and was writing code today that had me wondering if there are ever scenarios in which adhering to the DRY principle is ever not the best approach. Specifically, it was using PostgreSQL to find the lowest and highest price in a table, and then print a message ‘(user) got the (lowest/highest) price’. I used two different functions, but realized this could be done using a parameter for the table’s sort order, and an if-else condition to determine whether ‘lowest’ or ‘highest’ would go in the print statement. What are your thoughts on this scenario, as well as the idea of adding conditionals in order to stay DRY.
submitted by /u/Melvin1456
[link] [comments]
from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/ni027NK