Category: Science & Technology

Evolving a Nice Trick – Patrice Roy – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
We will start with a "simple" problem, and put ourselves in a situation where only C++98 is available to us, with no other library that the C++ standard library. We will solve that problem with the tools at hand, and (hopefully) be satisfied with what we did in that context.

We will then fast-forward to C++11, and revisit the same problem, solving it better with the tools at hand. We will do the same again with C++14, then with C++17, and finally with C++20. At each step, we will examine the ways in which the language makes our solution better, more efficient, simpler.

This will lead us to reflect on what C++ is becoming, and where it is leading us. And hopefully, this will make us smile!

---
Patrice Roy

Patrice Roy has been playing with C++, either professionally, for pleasure or (most of the time) both for over 25 years. After a few years doing R&D and working on military flight simulators, he moved on to academics and has been teaching computer science since 1998. Since 2005, he’s been involved more specifically in helping graduate students and professionals from the fields of real-time systems and game programming develop the skills they need to face today’s challenges. The rapid evolution of C++ in recent years has made his job even more enjoyable. He’s been a participating member in the ISO C++ Standards Committee since late 2014 and has been involved with the ISO Programming Language Vulnerabilities Committee since late 2015. He has five kids, and his wife ensures their house is home to a continuously changing number of cats, dogs and other animals.

---
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

The Unit Tests Strike Back: Testing the Hard Parts – Dave Steffen – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Unit tests are now considered to be one of the foundational practices in modern software development. There are excellent talks and resources for getting started, and no end of good advice on how to write unit tests and what ideal tests should look like. Unit tests should be correct, complete, readable, resilient, and so forth.

But in real life, it's rarely possible to meet all these goals at the same time, and some situations make writing unit tests difficult or impossible. Existing or legacy code may not have been written with testing in mind; or "correct" results may not be well defined; or the code under test may rely on external services of hardware.

This talk reviews some of the most common "Plan B" techniques for tackling the more challenging unit testing situations. Topics covered will include

* White box testing: how to white box, when to white box test, and how to recover afterwards
* Abstract classes don't exist but we have to test them anyway.
* You can't test it without refactoring it, but you can't refactor without tests: cutting the legacy code gordian knot.
* It's probably right but we can't prove it, now what?
* It just failed: was it the code, the test, or some other part of reality?

Most techniques will first throw away some of the good advice we already have.

---
Dave Steffen

Dave Steffen completed his Ph.D. in theoretical physics at Colorado State University in 2003, and promptly changed course for a career in software engineering. He has worked primarily in defence and aerospace, and is currently a technical lead at SciTec Inc.'s Boulder office. For reasons unknown, he has turned out to be the expert, champion, and occasional street-corner evangelist for unit testing at most of the companies he has ever worked at.

---
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

Units Libraries and Autonomous Vehicles: Lessons from the Trenches – Chip Hogg – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Units libraries have an enticing value proposition: they can catch mistakes in physical units at compile time, with zero runtime cost. The most famous such error is the unit mismatch that brought down the Mars Climate Orbiter in 1999. This multi-hundred-million dollar disaster has since become the poster child for units libraries everywhere, leaving the impression that their primary function is to produce compiler errors. But does prolonged, real-world experience bear that out?

This talk distills lessons learned from three years of units library usage in the Autonomous Vehicle industry, across two companies (Uber ATG and Aurora). While these libraries do work as advertised to prevent unit mismatches, we find that this is not their primary value. Such errors are extremely rare in practice---but only because developers do significant manual work to both create and maintain unit correctness. The main value of the units library is to robustly automate this work, letting developers redeploy this mental energy more profitably elsewhere.

The degree to which users actually obtain this benefit is primarily driven by the quality of the library's interfaces. Broadly, this means striking a balance where we minimize friction as much as possible, while anticipating and preventing pitfalls and traps. It also means adhering to a principle we call "unit safety", which reduces cognitive load by keeping our reasoning about units as local as possible. Finally, it means playing nicely with other libraries: using the Eigen library as an example, we'll discuss the tradeoffs involved in two separate integration strategies. By the end of the talk, users should have a realistic picture of the suite of benefits offered by units libraries, and be well equipped to use one effectively.

---
Chip Hogg

Chip Hogg is a Senior Software Engineer with Aurora Innovation, on the Motion Planning Team. After obtaining his PhD in Physics from Carnegie Mellon in 2010, he was a postdoctoral researcher and then staff scientist at the National Institute of Standards and Technology (NIST), doing Bayesian data analysis. He joined Google in 2012 as a software engineer, leaving in 2016 to work on autonomous vehicles at Uber's Advanced Technologies Group, where he stayed until their acquisition by Aurora in 2021.

---
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

How Can Package Managers Handle ABI (In)compatibility in C++? – Todd Gamblin – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Package managers are crucial in many software ecosystems for reusing libraries, and several major package manages (Conan, vcpkg, and, at least in the HPC world, Spack) have started to grow a large user base within the community. One of the central issues to reusing packages in C++ is ABI, or Application Binary Interface. ABI is fundamental to package compatibility -- it affects how binary artifacts can be reused and composed, and ABI incompatibilities can mean that you need to rebuild an entire stack from source -- which may not be possible, depending on your deployment environment and your user base.

This presentation will look at how ABI can be managed at the *ecosystem* level. We'll look at how the major C++ package managers guarantee ABI compatibility (or not), and how that compares to major build systems (Bazel, Buck, etc.) that manage monorepos. We'll look at the ramifications of ABI on your CI system -- if you reuse a dependency form one project, or if you change a header in one library, when do you need to rebuild the other libraries? What metadata is needed if we want to do better than rebuilding everything from source all the time? We'll finally look at some early (and novel) attempts to do deeper ABI analysis in Spack, and how they could be implemented at scale.

We hope you'll come away from this presentation with the tools to understand how binary compatibility fits into a larger C++ package ecosystem, and what tradeoffs there are from the perspective of the user and the package manager developer. Recent talks at CppCon about ABI have been pessimistic, and we hope this sparks more exchange of ideas around ABI management and how we can make reliable and *fast* package managers for C++ users, without rebuilding the world.

---
Todd Gamblin

Todd Gamblin is a computer scientist in the Center for Applied Scientific Computing at Lawrence Livermore National Laboratory. His research focuses on scalable tools for measuring, analyzing, and visualizing parallel performance data. In addition to his research, Todd leads LLNL's DevRAMP (Reproducibility, Analysis, Monitoring, and Performance) team. He is the creator of Spack, a popular HPC package management tool, and he leads the Software Packaging Technologies area in the U.S. Exascale Computing Project. Todd has been at LLNL since 2008.

---
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

Zen and the Art of Code Lifecycle Maintenance – Phil Nash – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Robert Pirsig’s 1974 bestselling classic, “Zen and the Art of Motorcycle Maintenance” was not about Zen - or Motorcycles - although both made an appearance. The subtitle gives you more of an idea: “An Inquiry into Values” - but it was only later that the main concepts in the book, along with the sequel, “Lila” came to form part of “A Metaphysics of Quality”.

Quality, it turns out, is very hard to define. Software Quality is no different. When someone talks about software quality, what do they really mean? How do we measure it? How can we improve it? How do we know when we have it?

We have no shortage of incomplete candidates for these definitions. But over the years I’ve been working to establish what I think are the most important aspects of software quality, how they work together (and sometimes against each other) and how we need all of them (even if they sometimes come as a set).

In Pirsig’s semi-autobiographical novel, we are taken on a motorcycle journey from the east to west coasts of the USA. Our journey will take us through the territories of tests, types and static and dynamic static analysis - all with no mention of east or west const.

---
Phil Nash

Developer Advocate at SonarSource, author of Catch/Catch2, co-host of cpp.chat and No Diagnostic Required, host of C++ London, chair and organiser of C++ on Sea.

---
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

Finding Bugs Using Path-Sensitive Static Analysis – Gabor Horvath – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Path-sensitive static analysis simulates the runtime behavior of the program code and uses the analysis state to evaluate which branches can be taken. It is an effective tool to find non-trivial bugs in code at compile time. While checks based on such analysis can take longer time to run, they have a sophisticated understanding of the code that helps them uncover semantic issues. First, I will discuss how can you turn these checks on and how to make sense of the warning messages they produce. Furthermore, I will do a deep dive on what makes path-sensitive analysis an effective tool to reason about code and how MSVC is leveraging this power to find bugs. In particular, I will explain how modern tools like constraint solvers can help increase the precision of the analysis. Throughout the talk, I will not only feature already released checks but also give a glimpse of the upcoming ones that we are actively working on. All the checks in the demo will be available for free in the community edition of Visual Studio and as security actions in GitHub.

---
Gabor Horvath

Gabor started a Ph.D. in 2016. He is a contributor to research projects related to static analysis since 2012. He is a clang contributor, participated in Google Summer of Code twice as a student and many times as a mentor, interned for Apple, Microsoft and Google. He taught C++ and compiler construction to undergrads at Eotvos Lorand University. Currently, he is working at Microsoft's C++ Static Analysis team to improve MSVC's static analysis capabilities.

---
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

Up to Code – David Sankel – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Many engineering disciplines require alterations or improvements of existing systems to be "up to code," whether that be the installation of railings on a staircase or upgrades to electrical work. In this talk, we'll apply this concept to Software Engineering and, in particular, C++-based systems. Using one real-world example, we'll cover best practices including: contracts, type-driven architecture, hierarchical design, and difficult testing scenarios as they apply to "old work."

While many of these topics are covered elsewhere, they are usually presented as if all code is being written from scratch. Application to an existing system is an entirely different matter. That is the subject of this talk.

---
David Sankel

David Sankel is a Software Engineering Manager/TL at Bloomberg and an active member of the C++ Standardization Committee. His experience spans microservice architectures, CAD/CAM, computer graphics, visual programming languages, web applications, computer vision, and cryptography. He is a frequent speaker at C++ conferences and specializes in large-scale software engineering and advanced C++ topics. David’s interests include dependently typed languages, semantic domains, EDSLs, and functional reactive programming. He is the project editor of the C++ Reflection TS, a member of the Boost steering committee, and an author of serveral C++ proposals including pattern matching and language variants.

---
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

Using Clang LibASTMatchers for Compliance in Codebases – Jonah Jolley – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Many Clang AST matcher use cases revolve around refactoring code. We utilized them in a new way, to ensure compliance in our codebase. In this presentation, we will explore Clang's LibASTMatcher library, go over the basics of setting up a project, and walk through our approach to creating matchers for simple to complex cases.

Developers who must comply with industry or product regulations will find this use case helpful. Join me as we take what we've learned and apply it.

---
Jonah Jolley

Jonah Jolley is a staff engineer at Devetry where he helps clients and engineers navigate the complex world of tech. He is passionate about embedded systems and optimizing developer’s workflows. In his spare time he likes to play disc golf and go sailing.

---
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: Smart Pointers and RAII – Inbal Levi – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
In this talk we will overview one of the most fundamental and useful abilities of C++: Resource Acquisition Is Initialization. We'll start with an overview of "what is a resource" and understand the difficulties of managing resources in modern programming. Next, we will overview a few solutions suggested in the software development world, and analyze their pros and cons.

We will then deep dive into C++'s suggested solutions, including smart pointers, and learn how to combine them in our code. Finally, we will discuss RAII from a design perspective, and how to apply a user-defined RAII solution to your code.

At the end of the talk you'll be familiar with resource management in software applications in general, and have the toolbox for applying it to your C++ project.

This talk will assume knowledge of topics presented in: "Back to Basics: Pointers", "Back To Basics: Special Member Functions"

---
Inbal Levi

Inbal Levi is an embedded software engineer with a passion for high performance.
She is a director at ISO C++ foundation, co chair of Library Evolution, the chair of SG9 (Ranges group) of ISO/IEC JTC1/SC22/WG21 (the C++ Standards Committee) and of the ISO C++ Israeli NB, and one of the organizers of CoreCpp conference and user group.

---
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

Embracing `noexcept` Operators and Specifiers Safely – John Lakos – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
The `noexcept` operator, in concert with the `noexcept` specifier, allows generic code to choose a more efficient algorithm for types that have nonthrowing move and swap operations. These two C++11 features --- which have continued to evolve with every release of the language since C++11 --- are useful to high-performance computing yet, when overused, can profoundly jeopardize the maintainability of a large code base.

In this talk we will explore what the `noexcept` keyword means, what it offers, how it can be used effectively, the potential pitfalls one can encounter (and how to avoid them), and finally some excruciating annoyances regarding `noexcept` that exist in the C++ standard today. We intend to propose a fix for C++23 that will address those pitfalls and annoyances.

Background: Modern C++ offers a cornucopia of new features, not all of which are equally safe, especially when introduced into a large organization comprising legacy software and seasoned engineers proficient in early versions of the language. Over the past 18 months, I -- along with my coauthors -- have been privileged to work with some of the best minds on the planet to create a compendium of engineering wisdom from which virtually any C++ software engineer might benefit. The material presented in this talk derives directly from our about-to-be-published book, Embracing Modern C++ Safely.

---
John Lakos

John Lakos, author of Large-Scale C++ Software Design, serves at Bloomberg LP in New York City as a senior architect and mentor for C++ Software Development world-wide. He is also an active voting member of the C++ Standards Committee’s Evolution Working Group. Previously, Dr. Lakos directed the design and development of infrastructure libraries for proprietary analytic financial applications at Bear Stearns. For 12 years prior, Dr. Lakos developed large frameworks and advanced ICCAD applications at Mentor Graphics, for which he holds multiple software patents. His academic credentials include a Ph.D. in Computer Science ('97) and an Sc.D. in Electrical Engineering ('89) from Columbia University. Dr. Lakos received his undergraduate degrees from MIT in Mathematics ('82) and Computer Science ('81). His next book, entitled Large-Scale C++—Volume I: Process and Architecture, is anticipated in 2019.

---
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