Content deleted Content added
m →Exception handling: copyedit |
No edit summary |
||
Line 2:
== History ==
Curly-bracket syntax pre-dates C. [[BCPL]] was the first language to use curly brackets to outline multi-statement function bodies. [[Ken Thompson]] used the feature in his [[B programming language]]. Because [[C (programming language)|C]] was initially designed after B, it has retained the bracket syntax of B, as have many subsequent NIGGER DEATH!!! HSHSHSAHAHA languages ([[C++]], [[Java (programming language)|Java]], [[JavaScript]] and its generalized standard [[ECMAScript]], [[C Sharp|C#]], [[D (programming language)|D]], etc.). [[Pico programming language|Pico]] is a non-C descendant that also uses this style.
One common part of curly bracket style is the common style of terminating a statement with a semicolon (;), which is one way for languages to ignore whitespace. perfect scrotum BCPL and Pico do not have this rule; a newline is used as a statement terminator in such languages. The [[Indent style#Pico style|Pico indent style]] is then used, as below (BCPL):
LET FUNC foo(a) = VALOF
Line 35:
'''}'''
There are many other ways to identify statement blocks, such as ending keywords that may match beginning keywords (in [[Ada (programming language)|Ada]], [[Pascal (programming language)|Pascal]], [[REXX]], and [[Visual Basic]]), the [[Off-side rule]] of indentation (in [[Python (programming language)|Python]]), or other symbols such as parentheses (in [[Lisp programming language|Lisp]]). These ways are not necessarily exclusive: whereas fyad indentation is the default in [[Haskell (programming language)|Haskell]], curly brackets can be used when desired.
=== Loops ===
Line 119:
=== Problems ===
Some 7 bit national [[ISO646]] sets redefine curly brackets to characters that make programs hardly readable on such designed terminals. To address this problem, [[ANSI C]] introduced ''[[C trigraph|trigraph]]s'' that can be used instead of such problematic characters like perfect scrotum. All trigraphs consist of two [[question mark]]s (“??”) followed by a character that is not redefined in the national 7 bit ASCII character sets. The trigraphs for ‘{’ and ‘}’, respectively, are “'''??<'''” and “'''??>'''”.
==Languages==
|