In Ruby, a code block (or just "Block") is an object that contains some Ruby code, and the context necessary to execute it. Code blocks are the most visually distinctive aspect of Ruby, and also one of the most confusing to newcomers from other languages. Essentially, a Ruby code block is a method that has no name. Most other languages have something like a Ruby code block: C's function pointers, C++'s function objects, Python's lambdas and list comprehensions, Perl's anonymous functions, Java's anonymous inner classes. These features live mostly in the corners of those languages, shunned by novice programmers. Ruby can't be written without code blocks. Of the major languages, only Lisp is more block-oriented.
Related white papers
Microsoft Visual Basic Series Part 5 - Migrating to Visual Basic .NET Part I
This session is part one of a two-part series that focuses on the key concerns of Microsoft Visual Basic 6.0 desktop application developers who are migrating to Microsoft .NET Windows...
UML Based Model-Driven Development for C
The Unified Modeling Language (UML) and Model-Driven Development (MDD) are rapidly becoming very hot topics and many companies are realizing the advantages made available by these technologies of better, standardized...
Model Driven Development for Systems Webinar
Rhapsody is fast becoming the leading MDD environment within the Mil/Aero community, being a major player in programs such as the Joint Strike Fighter (JSF), Future Combat Systems (FCS) and...
On Guard: Producing Run-Time Checks From Integrity Constraints
Software applications are inevitably concerned with data integrity, whether the data is stored in a database, files, or program memory. An integrity guard is code executed before a data update...
Bridging the Gap Between Systems, Software, and Test
Building off its initial and very successful UML 2.0 based Model-Driven Development (MDD) solution, Rhapsody 5.0, I-Logix has created a new generation solution to allow Systems, Software, and Test engineers...
Object-Oriented Project Management
Object-orientation is a way of looking at the world as "classes" of "objects" in order to model the real world more effectively than traditional structured software engineering or other methods...
Enterprise Unified Process: Enhancing the Unified Process to Meet the Real-World Needs of Your Organization
In short, not too good. Software projects are usually late, are usually over budget, are likely to be cancelled, and if not then the final software rarely meets the expectations of...


