What is the meaning of the term "canonical" in the programming context?

4

I have seen this term in many places in the area of programming.

For example, I've seen something like below, right here in SOpt:

  

"a canonical response is required"

The dictionary tells me that the word "canonical" means:

  

Canonic is an adjective that characterizes what is in agreement with   the canons, with the norms established or agreed.

But it seems to me something more related to religion. And in the context of programming, what does that really mean? What would be something canonical and something non-canonical in programming? What example in programming is the term used?

    
asked by anonymous 05.12.2017 / 00:35

1 answer

4
  

ca · nô · ni · co (latin canonicus, -a, -um) adjective

     
  • Of the canon or relative thereof.

  •   
  • According to the canons or dogmas of the Church.

  •   
  • [Linguistics] Following the more usual or more neutral structure in the language (eg, the canonical order of the elements of the sentence in Portuguese is   subject-verb-.object).

  •   

    "canonical", in Dictionary Priberam of the Portuguese Language [online],   2008-2013, link [consulted at   04-12-2017].

    In our context it may have slightly different meanings.

    Canonical is like a law, it is something that says unequivocally (within certain precepts) that this is true, preferably without noise interfering with this truth. It is a rule known and applied in general. There is no objection (under certain criteria, it is not enough to be a dogma).

    Canonical is something validated, consensual, universal domain, unique.

    Some synonyms: recognized, authoritative, accepted, sanctioned, approved, established, orthodox.

    One of the things we can say more about canonicality in programming is DRY . The truth of an object must be in only one place. You can not have two sources that treat the same thing as they can end up distancing themselves. Understand that letting something be modified and / or extended or composed in a liberated way as part of the architecture and if it is well thought out does not make something non-canonical. It is known as canonical form .

    In XML has a specific context . Or DNS . Or web content . Just to name a few.

      

    "a canonical response is required"

    We need an answer that serves as a universal reference, that is complete and correct, and says everything you need on the subject and that can be used to close several specific questions that are basically answered well with the generic canonical answer. An answer answers all the questions.

    If people understood every comma behind all canonical philosophy, separation of responsibilities and cohesion, they probably would not talk about OOP.

        
    05.12.2017 / 01:09