Learn English – What does “canonical” mean

adjectivesmeaning-in-context

Sometimes I read a sentence containing the word canonical, but I cannot find appropriate meaning of the word.

For example, in this link:

Returns a canonical representation for the string object.

It's hard for me to find an appropriate definition from Google:

ca·non·i·cal Adjective /kəˈnänikəl/

  1. According to or ordered by canon law
    • the canonical rites of the Roman Church
  2. Included in the list of sacred books officially accepted as genuine
    • the canonical Gospels of the New Testament
  3. Accepted as being accurate and authoritative
    • the canonical method of comparative linguistics
  4. (of an artist or work) Belonging to the literary or artistic canon
    • canonical writers like Jane Austen
  5. According to recognized rules or scientific laws
    • canonical nucleotide sequences
  6. Of or relating to a general rule or standard formula
  7. Of or relating to a cathedral chapter or a member of it

Best Answer

When this word is used by programmers, it is a synonym for "authoritative," "standard," or "official." That's meaning number 3 in the definition you quote.

It implies that there is one best, most official, most standard way to represent the string object and this is it.

For example sometimes things can be represented using a relative link or an absolute link. Relative might be something like ../foo.txt meaning "The file foo.txt in the folder above this one" while absolute is something like \\www.example.com\fileserver\share\foo.txt which can only refer to one file on the Internet. One might say that the latter name is canonical.

Related Topic