Björn Fahller: Modern techniques for keeping your code DRY
Channel: SwedenCpp
Date: 2019-09-02

We have learned to avoid repeating ourselves in code, and yet we keep writing things like:

if (a &lt 0 && b &lt 0 && c &lt 0) ...

In this session I will show techniques from modern C++ that helps you construct abstractions for those micro repetitions. These will allow you to write:

if (all_of(a, b, c) &lt 0) ...

Code like this expresses intent more clearly, and therefore makes it easier to follow the logic of the intended functionality instead of focussing on code details. This makes it easier to understand the functionality, and also makes it easier to spot mistakes. Better yet, these abstractions carry no run time cost.

After this session, you will be able to write your own zero-cost abstractions that helps getting rid of the patterns that keeps repeating in your code.

Slides:
https://speakerdeck.com/rollbear/modern-techniques-for-keeping-your-code-dry


StockholmCpp#24, kindly hosted at https://www.tritech.se

Event photos:
https://www.meetup.com/StockholmCpp/photos/30303864/

Our meetup group:
https://www.meetup.com/StockholmCpp

Visit also https://www.swedencpp.se for more information about C++ in Sweden