To prevent bugs and to make more flexible code, adopt the "do not repeat yourself", or DRY, principle. Popularised by the "pragmatic programmers", Dave Thomas and Andy Hunt, this principle states: "every piece of knowledge must have a single, unambiguous, authoritative representation within a system". FP tools are valuable because they provide tools to reduce duplication.
"Oh, Ariel, what irony!!" OK, I made up a quote from "The Tempest", but those two words seem to strike a chord when I read that snippet. DRY amounts to saying, "for each of the entity types, code and data, within each type build orthogonally". Yet, by building DRI into a SQL database (as close to the RM as we can currently get), one gets as much DRY as it is possible. Eliminates a tonne of code, too. Oops!! I suppose that's why coders will genuflect to DRY (even if they're non-practicing parishoners), but bring out the knives at any mention of DRI data. Dreadful partisanship.
No comments:
Post a Comment