Articles & Books

FUNGENOOP Programming -- Tony DaSilva

fungenoop.PNGIn case you missed it, here's a nice little Friday nugget:

FUNGENOOP Programming

by Tony DaSilva

From the article:

In his recent talks on C++, Bjarne Stroustrup always sets aside a couple of minutes to go off on a mini-rant against "paradigm shifts"...

From Mathematics to Generic Programming -- Alexander A. Stepanov, Daniel E. Rose

Hot off the presses today, at 320 pages:

From Mathematics to Generic Programming

By Alexander A. Stepanov, Daniel E. Rose

From the book description:

In this substantive yet accessible book, pioneering software designer Alexander Stepanov and his colleague Daniel Rose illuminate the principles of generic programming and the mathematical concept of abstraction on which it is based, helping you write code that is both simpler and more powerful.

If you’re a reasonably proficient programmer who can think logically, you have all the background you’ll need. Stepanov and Rose introduce the relevant abstract algebra and number theory with exceptional clarity. They carefully explain the problems mathematicians first needed to solve, and then show how these mathematical solutions translate to generic programming and the creation of more effective and elegant code. To demonstrate the crucial role these mathematical principles play in many modern applications, the authors show how to use these results and generalized algorithms to implement a real-world public-key cryptosystem.

As you read this book, you’ll master the thought processes necessary for effective programming and learn how to generalize narrowly conceived algorithms to widen their usefulness without losing efficiency. You’ll also gain deep insight into the value of mathematics to programming–insight that will prove invaluable no matter what programming languages and paradigms you use.

You will learn about

  • How to generalize a four thousand-year-old algorithm, demonstrating indispensable lessons about clarity and efficiency
  • Ancient paradoxes, beautiful theorems, and the productive tension between continuous and discrete
  • A simple algorithm for finding greatest common divisor (GCD) and modern abstractions that build on it
  • Powerful mathematical approaches to abstraction
  • How abstract algebra provides the idea at the heart of generic programming
  • Axioms, proofs, theories, and models: using mathematical techniques to organize knowledge about your algorithms and data structures
  • Surprising subtleties of simple programming tasks and what you can learn from them
  • How practical implementations can exploit theoretical knowledge

Perfect forwarding and universal references in C++ -- Eli Bendersky

plusprofilephoto.pngA nice tutorial on a feature that leads to convenient and safe calling code:

Perfect forwarding and universal references in C++

by Eli Bendersky

From the article:

One of the new features in C++11 aimed at increased code efficiency is the emplace family of methods in containers. std::vector, for example, has an emplace_back method to parallel push_back, and emplace to parallel insert.

Here's a short demonstration of the benefits these new methods bring: ...

Looking for C++17 - Urbana Proposals for Core, Modules, Networking, Reflection and UB

The second part of my series on the C++ Proposals for the next Committee meeting in Urbana:

Looking for C++17 - Urbana Proposals for Core, Modules, Networking, Reflection and UB

by Jens Weller

From the Article:

The second part of my series about the proposals for Urbana, where the next C++ committee meeting will be held. The papers grand us a first view on a distant future - C++17...

C++ and Zombies: a moving question

One of the issues I was thinking about since C++Now: move and move-destruction

C++ and Zombies: a moving question

by Jens Weller

From the article:

This has been on my things to think about since C++Now. At C++Now, I realized, that we've might got zombies in the C++ standard. And that there are two fractions, one of them stating, that it is ok to have well defined zombies, while some people think that you'd better kill them.

Introduction to Modern C++ -- Olve Maudal

A few days ago in Norway, well-known C++ expert Olve Maudal presented the following slides. We hope you enjoy them too.

Introduction to Modern C++ (PDF)

by Olve Maudal

From the presentation:

C++ has evolved a lot since it was first introduced as "C with classes" with primitive support for object-oriented programming. In particular during the last 10-15 years the common use of the language has changed "dramatically" and the language itself has evolved accordingly. Modern C++ (C++11/14) is still very suitable for object-oriented programming, but now the language also provides good support for generic programming and functional programming. All of this while C++ is still a low-level language that can be used to create programs that compete with programs written in assembler both in terms of speed and size.

We start with a brief history of C++ before focusing on new features in C++11/14 and a demonstration of some typical modern programming techniques.

Stroustrup highlights next C++ goals: Parallelism, concurrency -- Paul Krill

infoworld2.PNGToday in Infoworld, perhaps the first article about C++17:

Stroustrup highlights next C++ goals: Parallelism, concurrency

Language founder Bjarne Stroustrup gives early indicators of what to expect in C++17

by Paul Krill

Note: C++14 is just being published and C++17 may sound far away. But it's not -- some compilers, such as Clang 3.5 and Visual C++ "14" CTP, already go beyond C++14 and support draft-C++17 features like the new for(e:v) syntax.

From the article:

... Other major proposals for C++17 include faster compilation (championed mostly by Apple, Google, and Microsoft), contracts, and better type-checking. A meeting about the future of C++ is to be held by the standards committee at the University of Illinois, Urbana-Champa[ign], next week, Stroustrup says.

Second Edition of "The Boost C++ Libraries" Now in Print and Online

boost-schaeling.jpgThe second edition of Boris Schäling's "The Boost C++ Libraries" is now available in print form and (free) online. The print edition is available at Amazon and the online version is here

This edition covers 72 Boost libraries, almost twice as many as the previous edition and uses 430 complete, but as short as possible code examples.

For Boost libraries that were incorporated into the C++11 standard library, differences between Boost and the standard library are highlighted.

The goal of this book is to increase your efficiency as a C++ developer and to simplify software development with C++. The Boost libraries introduced in this book will help you write less code with fewer bugs and finish projects faster. Your code will be more concise and self-explanatory and more easily adapted when requirements change.

 

Template Metaprogramming with Modern C++: Templates in Depth -- Manu Sánchez

Template Metaprogramming Modern C++ in biicode

Recently on biicode:

Template Metaprogramming with Modern C++: Templates in Depth

by Manu Sánchez

From the article:

The last time  we learnt what metaprogramming was, how metaprogramming in C++ via templates works, and the functional spirit of the embedded language that C++ template metaprogramming is. In this post we will learn C++ templates in depth: Class and function templates, template parameters, variadic templates, all with in depth examples. ...

 

... Then the fact that the compiler only generates code which actually does something (All syntactic sugar that high-level constructs provide is thrown away):

int main()
{
    return Fibonacci<5>::value;
}

GCC 4.9 -std=c++11 -O0 x86 target:

main:                                   # @main
	movl	$55,