Content deleted Content added
m Stressed the special usage of the word "obeyed" |
→Control structures in practice: Ada example, NPOV: sort languages alphabeticly |
||
Line 126:
== Control structures in practice ==
Most programming languages with control structures have an initial keyword which indicates the type of control structure involved (Smalltalk is an exception). Languages then divide as to whether or not control structures have a final keyword.
* No final keyword: [[Algol programming language|Algol 60]], [[C programming language|C]], [[C plus plus|C++]], [[Java programming language|Java]], [[Pascal programming language|Pascal]], [[PL/I programming language|PL/1]].<br>
Such languages need some way of grouping statements together,
** PL/1: '''DO''' ... '''END'''
* Final keyword: [[Ada programming language|Ada]], [[Algol 68]], [[Modula-2]], [[Fortran]] (77 onwards). The forms of the final keyword vary:▼
** Fortran 77: final keyword is '''end''' + initial keyword, '''IF''' ... '''ENDIF''', '''DO''' ... '''ENDDO'''
Languages which have a final keyword tend to have less debate regarding layout and indentation. Languages whose final keyword is of the form: '''end''' + initial keyword (with or without space in the middle) tend to be easier to learn.
▲Final keyword: Algol 68, [[Modula-2]], [[Fortran]] (77 onwards).
▲Algol 68: initial keyword backwards e.g. '''if''' '''fi''', '''case''' '''esac''',<br>
▲Modula-2: same final keyword '''end''' for everything (now thought not to be good idea),<br>
▲Fortran 77: final keyword is '''end''' + initial keyword, IF ENDIF, DO ENDDO
== Choice ==
|