When working with methods which accept a parameter in various forms (e.g. nil, a single string, a single string containing multiple data or an array of strings) I tend to unify them - splitting, sanitizing and putting them into an array because this simplifies further processing and removes the need for nil, type and size checks. example (in Ruby): params = Array(original_param).map { |a| a.split(/\s*,\s*/) }.flattenparams.each{|p| process(p)}However, I have no idea what I am doing, at least I have no idea if there is a name for what I am doing. Is there?
Is there a name for the technique of converting method parameters into a unified form to simplify further processing?
terminology;parameters
The most common terms for this are canonicalisation and normalisation. In mathematics, a normal form is a standard way of representing an object with multiple equivalent representations. For example, these two logical expressions are equal:x  y  z(x  y  z)But the former is in disjunctive normal form while the latter is not.In programming, we typically talk about canonicalisation only when there is a singular canonical representation, for example, on a file system (ignoring hard links), the canonical representation of the path referred to by ../bar might be /foo/bar. In other cases, where the choice of normal form is arbitrary, normalisation is the preferred term.In the context of security, sanitisation refers to normalisation for the purposes of rendering malicious input harmless. This usually consists of enforcing language separation by escaping special characters or using type system features.