-2

I want to write some code that handles both data validation (for example, "field X must be alphanumeric") and data standardization (for example, "coerce field X into upper case"). I'd like a rubric for this code that encompasses these two functions without being significantly less terse than either of them (as, for example, using ValidationAndStandardization would be). An established term would be preferred, but inventions are better than nothing.

2
  • How about qualification?
    – heenenee
    Commented Aug 17, 2016 at 5:25
  • I'm closing this question as off-topic because it is not about a practical programming problem as outlined in the help center. Commented Aug 21, 2016 at 9:49

1 Answer 1

5

I would use parse1.

Technically, parsing only requires recognizing that an input matches some particular grammar--that is, the qualification part you've mentioned.

That's almost always accompanied by transforming input that allows an (often large) number of variations, and transforming it into some format that's standardized and relatively easy for other code to deal with. In fact, the transformation step is so common that I'm pretty sure most programmers would reject the idea of code really being a parser if it only verified conformance with a grammar.

The canonical example would be a compiler's parser, which verifies that the input (your program) is syntactically correct, and typically also produces something like an abstract syntax tree--the input code transformed into a format that's easier to work with, recognize patterns, further transform, etc.


  1. Paraphrasing parsimonious partners: parsing is paradise!

Not the answer you're looking for? Browse other questions tagged or ask your own question.