Curly bracket programming language: Difference between revisions

Content deleted Content added
mNo edit summary
Line 3:
 
== 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 [[B (programming language)|B]], his cut-down version of BCPL. Because [[C (programming language)|C]] was initially designed after B, it has retained the bracket syntax of B, as have many subsequent languages ([[C++]], [[Java (programming language)|Java]], [[JavaScript]] and its generalized standard [[ECMAScript]], [[C Sharp (programming language)|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. 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):
Line 97:
 
=== Exception handling ===
In [[C Sharp (programming language)|C#]] and Java:
try
'''{'''
Line 132:
*[[C shell]] (csh)
*[[C++]]
*[[C Sharp (programming language)|C#]]
*[[Ch interpreter|Ch]] - embeddable C/C++ interpreter
*[[ChucK]] - for audio programming