BoostCon 2012

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.

At Boostpro, our design process gives special weight to expresiveness so that our clients can wield the libraries with power and confidence.

News

  • The Future of C++

    Dave Abrahams has been thinking about what’s next for the C++ language in a series of articles at the C++Next blog.

    More...

  • Programmer’s Grimoire Interview: now in English

    Thanks to Takatoshi Kondo and colleagues, non-Japanese readers can now view this excerpt from Volume 2, “The Evolution of Languages” - Programmer’s Grimoire Interview with Dave Abrahams  

    More...

  • The latest issue of Programmer’s Grimoire features an interview with Dave Abrahams

    Vol.2 of the Japanese-language journal Programmer’s Grimoire, is subtitled “The Evolution of Languages.” If you don’t read Japanese, fear not, an English translation is coming soon.

    More...