Meaning – The word canonical, in computer science, refers to a particular expression that conforms to a set of rules. The term holds the same meaning as its mathematical counterpart, where it refers to concepts that are natural or unique.
In programming, the word canonical means ‘according to the rules’, while non-canonical means ‘not according to the rules’. The two words are used to easily distinguish whether a program follows a particular set of rules or not.
Example of usage – “While typing in the code into the editor, there programmer had to make sure that the commands were canonical, in order to avoid problems during compilation.”