Ada (programming language): Difference between revisions

Content deleted Content added
Features: fmt adjustment
Line 38:
Features of Ada include: [[Strong and weak typing|strong typing]], [[modular programming]] mechanisms ([[Modular programming|packages]]), [[run-time checking]], [[Parallel computing|parallel processing]] ([[Task (computing)|tasks]], synchronous [[message passing]], protected objects, and nondeterministic [[Switch statement|select statements]]), [[exception handling]], and [[generic programming|generics]]. Ada 95 added support for [[object-oriented programming]], including [[dynamic dispatch]].
 
The [[Syntax (programming languages)|syntax]] of Ada minimizes choices of ways to perform basic operations, and prefers English keywords (such as "{{code|or else"}} and "{{code|and then"}}) to symbols (such as "{{code||"{{!}}{{!}}}} and "{{code|&&"}}). Ada uses the basic arithmetical operators "{{code|+"}}, "{{code|-"}}, "{{code|*"}}, and "{{code|/"}}, but avoids using other symbols. Code blocks are delimited by words such as "'declare"', "'begin"', and "'end"', where the "'end"' (in most cases) is followed by the identifierkeyword of the block that it closes (e.g., ''{{code|if}} ... {{code|end if''}}, ''{{code|loop}} ... {{code|end loop''}}). In the case of conditional blocks this avoids a ''[[dangling else]]'' that could pair with the wrong nested 'if'-expression in other languages likesuch as C or Java.
 
Ada is designed for developing very large software systems. Ada packages can be compiled separately. Ada package specifications (the package interface) can also be compiled separately without the implementation to check for consistency. This makes it possible to detect problems early during the design phase, before implementation starts.
Line 50:
Though the semantics of the language allow automatic [[garbage collection (computer science)|garbage collection]] of inaccessible objects, most implementations do not support it by default, as it would cause unpredictable behaviour in real-time systems. Ada supports a limited form of [[region-based memory management]], and in Ada, destroying a storage pool also destroys all the objects in the pool.
 
A double-[[dash]] ("{{code|--"}}), resembling an [[em dash]], denotes comment text. Comments stop at end of line; there is intentionally no way to make a comment span multiple lines, to prevent unclosed comments from accidentally voiding whole sections of source code. Disabling a whole block of code therefore requires the prefixing of each line (or column) individually with "{{code|--"}}. While this clearly denotes disabled code by creating a column of repeated "'--"' down the page, it also renders the experimental dis/re-enablement of large blocks a more drawn-out process in editors without block commenting support.
 
The semicolon ("{{code|;"}}) is a [[statement terminator]], and the null or no-operation statement is <{{code>|null;</code>}}. A single <{{code>|;</code>}} without a statement to terminate is not allowed.
 
Unlike most [[International Organization for Standardization|ISO]] standards, the Ada language definition (known as the ''Ada Reference Manual'' or ''ARM'', or sometimes the ''Language Reference Manual'' or ''LRM'') is [[free content]]. Thus, it is a common reference for Ada programmers, not only programmers implementing Ada compilers. Apart from the reference manual, there is also an extensive rationale document which explains the language design and the use of various language constructs. This document is also widely used by programmers. When the language was revised, a new rationale document was written.