Block (programming): Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
Reverting edit(s) by 2001:44C8:4017:DDF0:1:0:9E90:F502 (talk) to rev. 1000481857 by Monkbot: Vandalism (RW 16.1)
Line 1:
{{redirect|Code block|the IDE|Code::Blocks}}
Blocks in programming is to enable groups of statements to be treated as if they were one statement and to narrow the of objects such as variables. Procedures and functions declared in a block so that they do not conflict with those having the same name used elsewhere. In a block-structured programming language the objects named in outer blocks are visible inside inner blocks unless they are Name masking masked by an object declared with the same name.
{{refimprove|date=May 2010}}
 
{{Programming paradigms}}
In [[computer programming]], a '''block''' or '''code block''' is a lexical structure of [[source code]] which is grouped together. Blocks consist of one or more [[Declaration (computer programming)|declarations]] and [[Statement (computer science)|statements]]. A programming language that permits the creation of blocks, including blocks nested within other blocks, is called a '''block-structured programming language'''. Blocks are fundamental to [[structured programming]], where [[control structure]]s are formed from blocks.
 
BlocksThe function of blocks in programming is to enable groups of statements to be treated as if they were one statement, and to narrow the [[lexical scope]] of objects such as variables., Proceduresprocedures and functions declared in a block so that they do not conflict with those having the same name used elsewhere. In a block-structured programming language, the objects named in outer blocks are visible inside inner blocks, unless they are [[Name masking |masked]] by an object declared with the same name.
 
==History==