What are annotations?
According to the Duden dictionary, the word annotation means nothing other than “remark” or “note”. The term derives from the Latin words annotatio, which can be translated as a written remark, and nota, which generally refers to a hint. In any case, annotations have a supplementary, explanatory character. They contain important additional information, but are not important for the main text in and of themselves. Depending on the discipline, an annotation fulfils further functions: in linguistics, for example, an annotation is the description of a syntactic structure. In philology, these are analytical or descriptive annotations within a text, such as general word type, case, genus or basic verb, singular or plural form.
Annotations in programming
Annotations in programming languages are, similar to those in linguistics, structural elements containing additional or meta-information in the source code of a program. These are ignored by the computer when running the software, but they are important here for inserting comments into the source code which simplify the understanding of the text or help to structure and divide the source code.
As language elements with very simple syntax, annotations are quite flexible, so they can be used for very different purposes: for example for documentation, hints, error avoidance, but also for compiler control (in which a compiler translates program code from higher programming languages so that the computer can execute it) and to define new annotations.
Scripting languages Java, C#, Python, Ruby and VB.NET are some of several programming languages that support the integration of annotations. In Java, there is already a set of predefined annotation types with fixed meanings that are identified by a specific character string. In the case of Java, for example, a prefixed “@” indicates an annotation. With the help of additional tools, annotations can also be inserted into programming languages in which the syntax does not currently provide them.
You might also be interested in these articles: