Boost Consulting

BoostCon 2008

Expressiveness

The expressiveness of source code is a qualitative measure of how directly it describes the intention of the programmer.

Effective code is dependent on two things: the programmer's understanding of what she wants to accomplish, and her ability to map that understanding onto the available language and library constructs. When understanding is clear and the mapping is direct, programs are more readable and maintainable, but writing them is also easier, faster, and more fun.

Constructs that make programming more expressive are often dismissed as "syntactic sugar," but syntax and abstraction clearly count, or we'd all be programming in assembly language. Just as C++ helps us express our ideas with high-level general-purpose constructs such as classes and functions, libraries provide specialized high-level abstractions—like smart pointers, date and time objects, parsers, and state machines—that allow us to express solutions to our programming problems in the same terms we use when thinking and speaking of them.

At its most expressive, programming takes on a declarative quality: rather than describing how the problem should be solved, one simply describes the problem itself, and the library provides all the procedural logic for a solution. For example, given a simple in-code grammar description, the Boost Spirit library generates an efficient parser. Compared with handwritten parsing logic, the resulting code is much more likely to be correct when written and is understandable at a glance. It also exhibits phenomenally effective decoupling: the programmer can change the language being parsed without becoming entangled in low-level details of token processing, and the library author can optimize or radically alter the basic parsing mechanism without disturbing application code.

News

  • BoostCon 2008: Early Reg. Deadline

    Early registration for BoostCon'08, the 2nd annual Boost Conference, closes on April 1. Register now to qualify for the “early bird” discount.

    More...

  • BoostPro Installer 1.34.1 Released

    Boost 1.34.1 is an important upgrade for users of the previous release, Boost 1.34.0, on Windows

    More...

  • Time Series Library Review

    The generic time series library is now undergoing a formal review on the main Boost developers' list.

    More...