Author: digitalmedium1

What Classes We Design and How – Peter Sommerlad – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

C++ class design has been error prone since the beginning until Scott Meyers told us about the Rule-of-Three. But even that is not enforced by the language. In addition, C++11 changed the set of compiler-provided special member functions and the intrinsic rules have become more complicated. However, instead of starting from the rules for special member functions, we will look at what role a class type plays and how that maps on what special member functions to define and how, if any. Examples for class roles are Value, Relationship, Manager (scoped, unique, general), Mix-in.

We will also look at the roles of member variable types that influence or imply the role of the class type.
The role of a class will also take out many mysteries of move operations and will lead to clear guidance when and how to implement move: for suppressing copying, for managing unique ownership (Unique Manager) or for optimizing object copies (General Manager).

We will rehearse the Rule of Zero, and learn more about the Rule of Five/Six, the Rule of DesDeMovA, and the Rule of Unique Three.

This all will enable you to much more consciously and safely design your class types and combine types of member variables. You will have then the ability to select from a few reasonable combinations from the plethora of possibilities of special member function combinations: {public:,protected:,private:} x {destructor, default constructor, copy constructor, copy assignment, move constructor, assignment} x {noexcept(true),noexcept(false)} x { =default, =delete, {/*body*/}, not declared } (math as homework)

---
Peter Sommerlad

Peter Sommerlad was director of IFS Institute for Software at FHO/HSR Rapperswil, Switzerland. Peter is co-author of the books POSA Vol.1 and Security Patterns and contributed to "97 things every programmer should know". His goal is to make software simpler and safer by Decremental Development: Refactoring software down to 10% its size with better architecture, testability and quality and functionality. To reach that goal his team and students created the C++ IDE Cevelop. Peter is a member of MISRA-C++, Hillside, ACM, IEEE Computer Society, SI, ACCU, and the ISO C++ standardization committee.
---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Cool New Stuff in Gdb 9 and Gdb 10 – Greg Law – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
GDB is bigger than you might think, and it's evolving fast. This is a depth-first walk through what's been added in versions 9 and 10. Depth-first meaning that no prior knowledge of these features is assumed, but even if you've used them before there should be plenty new for you. Few slides, lots of live demos. Some brand new things and some neat new additions to existing features. Topics include the new debuginfod facility; user-defined commands; enhancements to super-useful convenience variables such as $_siginfo, $_gdb_setting, $_gdb_setting_str; enhancements to TUI mode; how to add new TUI windows from GDB's Python scripting; advanced querying of types from GDB's Python scripting; and enhanced configuration of backtrace printing. You should learn at least two new tricks that will make improve you debugging effectiveness, and so make you a better programmer.

---
Greg Law

Greg is co-founder and CTO at Undo. He is a programmer at heart, but likes to keep one foot in the software world and one in the business world. Greg finds it particularly rewarding to turn innovative software technology into real business development. Greg has over 20 years of experience in both academia and innovative start-up software companies.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

Filed under: Science & Technology

Software Engineering Is About Tradeoffs – Mateusz Pusz – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

This talk presents a view of a Software Architect on designing interfaces. Often there is no such thing as "the best" solution for the problem. In many cases, we have to deal with compromises and accept the downsides of a specific approach. We often have to choose between exception safety guarantees, performance, dynamic allocations, and standardization or implementation effort.

During the talk, I will present some of the major trade offs and disagreements regarding the C++ design. I will also describe a few issues I encountered during the design of mp-units (the modern C++ physical units library) and ask the audience to make a choice between several alternative solutions to the problem.

---

Mateusz Pusz

A software architect, principal engineer, and security champion with more than 15 years of experience in designing, writing, and maintaining C++ code for fun and living. A trainer with 10 years of C++ teaching experience, consultant, conference speaker, and evangelist. His main areas of interest and expertise are Modern C++, code performance, low latency, safety, and maintainability.

Mateusz worked at Intel for 13 years, and now he is a Principal Software Engineer and the head of the C++ Competency Center at EPAM Systems. He is also a founder of Train IT that provides dedicated C++ trainings and consultant services to corporations around the world.

Mateusz is a contributor and an active voting member of the ISO C++ Committee (WG21) where, together with the best C++ experts in the world, he shapes the future of the C++ language. He is also a co-chair of WG21 Study Group 14 (SG14) responsible for driving performance and low latency subjects in the Committee. Recently also joined MISRA to help make self-driving cars safer.

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Multi Threading Model in Paradox Games: Past, Present and Future – Mathieu Ropert – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

Paradox grand strategy games are all about simulating history through various lenses (politics, economy, warfare, diplomacy, demographics...) in real time. Over the last 20 years, our games have become more complex and more demanding on CPU computations.
In this talk we will see how the threading model of the game simulation evolved over time to try and deliver the necessary throughput and latency required to keep the games fluid with more and more complex systems.
We will focus on 3 models, the "old" which is shared by some long running production games such as Europa Universalis IV, Hearts of Iron IV and Stellaris, the "current" model brought by Crusader Kings 3 and finally discuss some thoughts and ideas of what future games may experiment with.

---

Mathieu Ropert

Tech Lead, Paradox Development Studio
French C++ expert working on (somewhat) historical video games. Decided to upgrade his compiler once and has been blogging about build systems ever since. Past speaker at CppCon, Meeting C++ and ACCU. Used to run the Paris C++ User Group. Currently lives in Sweden.

---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Breaking Dependencies: Type Erasure – A Design Analysis – Klaus Iglberger – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

This session is part of the Software Design Track.

“If I could go back in time and had the power to change C++, rather than adding virtual function, I would add language support for type erasure …” (Eric Niebler, June 19, 2020, Twitter).

For many developers type erasure is superior to inheritance. And indeed, it has proven itself to be a powerful design pattern, helping to significantly reduce coupling between software entities.

This talk will give a short introduction to type erasure, with a particular focus on the design aspect of the technique. After attending this session, attendees will understand why type erasure provides such a strong decoupling and why this makes it superior to inheritance in terms of dependency management.

---
Klaus Iglberger

Freelancer
C++ Trainer/Consultant
Klaus Iglberger is a freelancing C++ trainer and consultant. He has finished his PhD in computer science in 2010 and since then is focused on large-scale C++ software design. He shares his experience in popular advanced C++ courses around the world (mainly in Germany, but also the EU and US). Additionally, he is the initiator and lead designer of the Blaze C++ math library (https://bitbucket.org/blaze-lib/blaze/src/master/) and one of the organizers of the Munich C++ user group (https://www.meetup.com/MUCplusplus/).

---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

A Case-study in Rewriting a Legacy GUI Library for Real-time Audio Software in Modern C++ – Roth Michaels

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
A case-study in the design and development of iZotope's GUI framework, for real-time audio software, using C++17 to eliminate common sources of bugs and increase developer productivity. To illustrate this process, we will study GlassProperties, a new open-source library for property serialization and accessor method synthesis. While designed to support building GUIs for real-time audio software, GlassProperties is a general purpose framework not tied to any one GUI library and could easily be adapted into your GUI or any part in your tech stack.

We will cover the library design process, starting with analysis of legacy code and bugs to develop user problem statements. These user problems will be our guide for wrapping a legacy system with a new type-safe API using C++17 compile-time meta-programming so that run-time bugs become compile-time errors. Once we arrive at a C++17 design, we will close with a brief look to the future and how the library would look with C++20 Concepts.

In addition to learning the software design techniques to succeed in this rewrite, some lessons learned will be shared so you will be armed with both the C++ skills and business strategy to take on a project like this at your organization.

---
Roth Michaels

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Hazard Pointer Synchronous Reclamation Beyond Concurrency TS2 – Maged Michael – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
The hazard pointer deferred reclamation technique supports low-latency access to dynamic objects by deferring the reclamation of objects that may be removed while being accessed concurrently until reclamation is safe. Many uses of hazard pointers require support for synchronous reclamation, that is, guarantees for the timing of reclamation of some objects, primarily due to the dependence of the deleters of such objects on resources that may become subsequently unavailable.

The upcoming WG21 Concurrency Technical Specification (Concurrency TS2) includes support for hazard pointer synchronous reclamation. This talk describes such support and goes beyond the TS and describes a faster scalable alternative interface for synchronous reclamation and novel algorithms for implementing it that are in heavy use in the Folly open-source library.

Fast and scalable synchronous reclamation for deferred reclamation has been a long-standing open problem. This talk presents a new interface and algorithms that solve the problem. Objects protectable by hazard pointers are organized into cohorts. The completion of the destruction of a cohort object guarantees the completion of the destructors for all associated protectable objects, thus providing synchronous reclamation by controlling cohort destruction. A significant algorithmic challenge is the interaction between synchronous and asynchronous reclamation. Asynchronous reclamation serves to bound the number of reclaimable objects that are not yet reclaimed. The talk outlines how the new algorithms manage to support both types of reclamation safely while allowing synchronous reclamation to be fast and scalable.

The talk concludes with a proposed roadmap for hazard pointer synchronous reclamation standardization beyond Concurrency TS2.

---
Maged Michael

Maged Michael is a software engineer at Facebook. He is the inventor of hazard pointers, lock-free malloc and several algorithms for concurrent data structures. He received a Ph.D. in computer science from the University of Rochester. He is an ACM Distinguished Scientist. He is an elected member of the Connecticut Academy of Science and Engineering. He received the 2014 ACM SIGPLAN Most Influential PLDI Paper Award for his paper on Scalable Lock-Free Dynamic

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Deducing this Patterns – Ben Deane – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
How would our code change if a member function could deduce the type and value category of the object ("this") it worked on?

Potentially a lot, and this talk will highlight some of those changes. Because with C++23, member functions will be able to do just that using a feature described in P0847, "Deducing this". Many patterns in C++ today could change, and new patterns will arise. This talk will explore those patterns, explain how "deducing this" works, and show how it solves the problems that originally motivated the paper.

Some sample effects on our code: CRTP is simplified; decorators become much easier and terser; recursive lambda expressions become straightforward. There are also implications for safely and efficiently moving values through computations.

---
Ben Deane

Ben was a game programmer for over 20 years, working in C++ since the late 90s, for companies like EA and Blizzard. In 2018 he left the games industry to join Quantlab, an automated trading firm, where he writes modern, well-performing C++. He likes to play with algorithms, and to make the type system work for him, and he’s always looking for useful new techniques. Ben is the presenter of several previous C++Now and CppCon talks.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Back to Basics: Casting – Brian Ruth – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
“In all cases, it would be better if the cast ... could be eliminated” --Bjarne Stroustrup. As this quote attests, casting has been controversial from the beginnings of C++ and yet, when used judiciously, continues to be a very powerful tool for the language. In this back to basics talk, we will look at the history of casing in C++, why we have the casts that we do have, how casting interacts with run time type information (RTTI), and what the compiler actually does when we add casts to our code. When we’re done, you should be able to know when to use (or not use) a cast and what effect it will have on your project.

---
Brian Ruth

Brian has been programming in C++ for 20+ years; working for both small and large companies on a wide variety of projects and technologies. For over a decade he worked with neuroscience researchers and created high speed acquisition, analysis and visualization software. He is currently a senior software engineer at Garmin, developing embedded devices and migrating legacy modules to C++. When he isn’t knee deep in code, he is enjoying a home brewed beer or building some furniture. He has been a volunteer at CppCon since 2015.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

C++20 ❤ SQL – John Bandela – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
SQL is *the* language for database manipulation. However, interfacing it to C++ in a type safe manner can be awkward, requiring either preprocessors, boilerplate, or loss of type safety.

In the past, to achieve type safety, people have written domain specific languages. However, a DSL comes with its own issues, including how to specify the DSL data model, how to support the richness of SQL semantics, and how to translate SQL to the DSL.

C++20 provides us the features to be able to use SQL queries almost directly in C++ in a type safe way. With some minimal, specialized SQL comments, we can generate type safe parameter and result row bindings in C++ at compile time from an SQL query string.

No macros, no preprocessors, no boilerplate!

Just awesome standard C++20.

Join us as we explore how we can unleash the full power of two amazing languages: C++ and SQL!

---
John Bandela

I first started programming in C++ at age 14 in 1994 when I cajoled my parents into buying me Visual C++ 1.0 for my birthday. It took a while, but as I learned the language, I decided I really liked C++. I attended the University of Florida and obtained my undergraduate degree in Computer and Information Science. During my undergraduate time, I created and submitted Boost.Tokenizer. I went on to medical school and neurosurgery residency, but decided to do something with a little less scary undefined behavior and returned to programming in C++.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology