Content deleted Content added
Citation bot (talk | contribs) Add: journal, s2cid. | Use this bot. Report bugs. | Suggested by Abductive | #UCB_webform 1789/3850 |
short description, links Tags: Mobile edit Mobile app edit iOS app edit |
||
Line 1:
{{Short description|Lexical structure of source code grouped together}}
{{redirect|Code block|the IDE|Code::Blocks|block-based programming|Visual programming language}}
{{refimprove|date=May 2010}}
{{Programming paradigms}}
In [[computer programming]], a '''block''' or '''code block''' or '''block of code''' 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.▼
▲In [[computer programming]], a '''block''' or '''code block''' or '''block of code''' 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 [[Nesting (computing)|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.
Blocks have two functions: to group statements so that they can be treated as one statement; and to define [[scope (computer science)|scopes]] for [[name binding|names]] to distinguish them from 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.▼
▲Blocks have two functions: to group statements so that they can be treated as one statement; and to define [[scope (computer science)|scopes]] for [[name binding|names]] to distinguish them from 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 (computer science)|object]] declared with the same name.
==History==
|