Tag: softwareengineering

Aliasing in C++ – Risks, Opportunities and Techniques – Roi Barkan – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Aliasing in C++ - Risks, Opportunities and Techniques - Roi Barkan - CppCon 2022
https://github.com/CppCon/CppCon2022

The notion of *aliasing* in C++ is one of the trickiest legacy attributes inherited from C. Prevalent when writing object-oriented code, it can cause hard-to-spot functional bugs and far-too-common performance penalties.

In this talk we'll learn where aliasing appears, how impactful it can be, and how we can avoid it when needed. We'll also see when we might harness it to our advantage when appropriate.

We'll see and understand various examples of unexpected behavior and performance, and learn to inspect our code for common aliasing pitfalls.

We'll learn the details of *strict aliasing* rules, and use them to understand how to use get the compiler to understand what we mean. We'll understand how strong-typedefs, value-based design and various potential standards-proposals can be used to make our code more readable and more expressive.
---

Roi Barkan

Professional software developer and architect since 2000, Roi's main focus throughout his career was on high performance and distributed systems, implementing complex and innovative algorithms. Roi has been the VP technologies of Istra Research since 2014, where he helps creating low latency financial systems. Prior to working for Istra Research, Roi spent 12 years in software development, architecture and management in the IT Security field. Roi received his B.A in Computer Science with high honors from the Technion in Israel, and his executive MBA from Tel Aviv University.
---

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

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

Using std::chrono Calendar Dates for Finance in Cpp – Daniel Hanson – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Using std::chrono Calendar Dates for Finance in C++ - Daniel Hanson - CppCon 2022
https://github.com/CppCon/CppCon2022

Dates and date calculations might not sound exciting, but they are vitally important in financial software development, particularly in areas such as fixed income analytics, mortgage backed-securities (MBS), and interest rate derivatives. A prime example is in applying the correct day-count convention to interest rate derivative calculations, as failure to do so can result in potentially significant losses for a trading desk.

Up until C++20, C++ financial developers had to rely on an external library for dates, or write their own customized code. This has now fortunately changed with the addition of the `std::chrono` calendar date classes.

Some of the operations are not exactly trivial, however, as one needs to identify and use the appropriate tools in the library. For example, naively applying the addition assignment operator to add a period of two months to December 30 can result in an invalid date of February 30. Another possible complication is if a date generated in a payment schedule falls on a non-business day at the end of the month. Remedies in these cases are provided by using a std::chrono object that represents the last day of the month object rather than a standard date.

Handling edge cases such as these is standard fare in working with financial date calculations. Methods available in `std::chrono` to adjust for them will be presented, and then parlayed into designing C++ code to properly generate a schedule of cash flows, perform business day adjustments for weekends and end of the month, construct and interpolate a term structure of interest rates, and calculate the present value of fixed income securities such as bonds and interest rate swaps.
---

Daniel Hanson

Daniel Hanson spent 24 years in quantitative development in finance, primarily with C++ implementation of option pricing and portfolio risk models, and related library development. He subsequently held a full-time lecturer position through 2022 in the Department of Applied Mathematics at the University of Washington, teaching quantitative development courses in the Computational Finance & Risk Management (CFRM) graduate and undergraduate programs. This included intermediate and advanced classes in computational C++, and mentoring students in Google Summer of Code projects involving implementation of mathematical models in C++ and R.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

How C++23 Changes the Way We Write Code – Timur Doumler – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.org/
---

How C++23 Changes the Way We Write Code - Timur Doumler - CppCon 2022
https://github.com/CppCon/CppCon2022

C++20 was a huge release: coroutines, concepts, ranges, and modules profoundly changed the way we write code and think about C++. In comparison, C++23 is a lot smaller in scope: its primary mission is to complete C++20, to fill holes, and to fix issues. Nevertheless, some great new features made the cut this time around, both in the standard library and in the core language. This is even more remarkable considering that the entire feature design phase of C++23 took place during the COVID-19 pandemic, challenging the ISO C++ committee to completely reinvent how we work together.

This is not a firehose talk about C++23 that tries to cram as many additions and improvements as possible into one hour. Instead, we deliberately focus on just a handful of new features that are going to noticeably change and improve the experience of the everyday C++ programmer. We will talk about how `std::expected` improves error handling, the huge impact that `std::mdspan` will have on scientific computing, how deducing `this` greatly simplifies longstanding C++ idioms such as CRTP, and how `std::print` will forever change how we write "Hello, World".
---

Timur Doumler

Timur Doumler is the Developer Advocate for C++ tools at JetBrains and an active member of the ISO C++ standard committee. As a developer, he worked many years in the audio and music technology industry and co-founded the music tech startup Cradle. Timur is passionate about building inclusive communities, clean code, good tools, low latency, and the evolution of the C++ language.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #coding

Filed under: UncategorizedTagged with: , , , , ,

Cute C++ Tricks, Part 2.5 of N – Code You Should Learn From & Never Write – Daisy Hollman – CppCon22

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Cute C++ Tricks, Part 2.5 of N - More Code You Should Learn From and Never Write - Daisy Hollman - CppCon 2022
https://github.com/CppCon/CppCon2022

During the COVID-19 global pandemic, as we all searched for ways to stay connected to the C++ community, these 25-line or less C++ snippets of counterintuitive C++ code called the "Cute C++ trick of the day" started to appear on Twitter. The amount of attention these tricks got was surprising, and as more were posted, it became clear that these counterintuitive snippets of C++ code offer pithy and memorable ways to teach people some intermediate or advanced aspects of C++ (that often come up in real code!).

This talk builds on part 1 (of N), presented last year at CppCon 2021. In this presentation, I will dissect a few more of the most popular "Cute C++ tricks" to a level of detail not possible on social media platforms like Twitter. I'll talk about how and why these tricks work the way they do, talk about the dark corners of C++ they touch upon, and talk about what you should actually do if you need to produce the same effect in production code. While not targeted at beginners, these tricks span the gauntlet from features that most intermediate programmers are aware of (but never thought to use in a particular way) to dark corners of the language that many of my C++ committee colleagues were surprised to learn about. Throughout it all runs a common thread: learning how to exploit your own curiosity to expand your toolbox, gain a better grasp of the fundamentals of C++, and ultimately, become a better programmer.
---

Daisy Hollman

Dr. Daisy S. Hollman began working with the C++ standards committee in 2016, where she has made contributions to a wide range of library and language features, including proposals related to executors, atomics, generic cppcon.digital-medium.co.uk/tag/programming/">programming, futures, and multidimensional arrays. Since receiving her Ph.D. in Quantum Chemistry in 2013, her research has focussed primarily on parallel and concurrent cppcon.digital-medium.co.uk/tag/programming/">programming models, though a broader focus on general accessibility of complex abstractions has become her focus in more recent years. She currently works on C++ language and library design at Google, where she continues to focus on providing broad accessibility of cppcon.digital-medium.co.uk/tag/programming/">programming models and abstractions, with a particular focus on design for diversity and inclusivity.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

C++20’s [[likely]] Attribute – Optimizations, Pessimizations, and [[unlikely]] Consequences – by Amir Kirsh & Tomer Vromen – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

C++20’s [[likely]] Attribute - Optimizations, Pessimizations, and [[unlikely]] Consequences - CppCon
https://github.com/CppCon/CppCon2022

C++20 added the [[likely]] and [[unlikely]] attributes, which formalize existing compiler builtins. As users of the latest standards, we all want to use them in our code and get better performance - but should we?

In this talk we investigate what these attributes mean, the risk of using them incorrectly (and even the risk of using them correctly!) and whether they’re actually worth the effort. We will dive deep into branch prediction, optimizations and pessimizations, and the art of benchmarking. We will see that in C++ questions that seem simple to begin with do not get a simple answer, but an interesting one!

Participants of the talk will hopefully improve their knowledge of performance tuning, and how to focus efforts in things that really matter for performance.
---

Amir Kirsh

C++ lecturer at the Academic College of Tel-Aviv-Yaffo and Dev Advocate at Incredibuild. Previously the Chief Programmer at Comverse. Co-organizer of Core C++ conference and a member of the Israeli ISO C++ NB. Currently a visiting researcher at Stony Brook University, New-York.

Tomer Vromen

Software engineer at Dell Technologies, cppcon.digital-medium.co.uk/tag/programming/">programming in C++ for 10 years. Interested in algorithms, software development, and long distance running.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

Nobody Can Program Correctly – Lessons From 20 Years of Debugging C++ Code – Sebastian Theophil – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.org/
---

Nobody Can Program Correctly - Lessons From 20 Years of Debugging C++ Code - Sebastian Theophil - CppCon 2022
https://github.com/CppCon/CppCon2022

We like to write code but—despite our best efforts—we make mistakes. Our program will contain bugs. Sometimes, we don’t write what we mean to write, sometimes we don’t understand an aspect of our programming language and at other times we lack—or fail to consider—some critical information about our program’s system environment. As a result, our program will not behave correctly. What do we do now?

In this talk, I would like to take you through the entire debugging process, starting with a program that crashes. What do we do next? Which questions do we have to ask? What information do we need? What can we do to find the cause of the crash? Which tools can help us in this quest, and, last but not least, what can we do to make sure this bug never happens again?

Thanks to real-world examples that we have encountered — and debugged — over the years, you will learn how to reproduce, locate, understand and fix even the most difficult bugs.
---

Sebastian Theophil

Sebastian has been working at think-cell Software since its founding in 2002. In the last few years, among many other things, he has ported think-cell to run on macOS.

He is also the maintainer of the typescripten project which lets programmers call JavaScript libraries from C++ code compiled to WebAssembly in a convenient and type-safe way. He enjoys to leave this desk from time to time to talk at international C++ conferences and has previously given talks at CppNow, CppCon, and ACCU.
---

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

#cppcon #programming #debugging

Filed under: UncategorizedTagged with: , , , ,

Back to Basics – Name Lookup and Overload Resolution in C++ – by Mateusz Pusz – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Back to Basics - Name Lookup and Overload Resolution in C++ - Mateusz Pusz - CppCon 2022
https://github.com/CppCon/CppCon2022

This talk explains how name lookup and overload resolution works. The language rules are not easy at all and may not be what one could expect. During the lecture, I will describe in detail how the process works, what are the pitfalls, and how to avoid them.

This talk is part of the Back to Basics track and the material will be targeted to include all skill levels. Familiarity with the C++ language is recommended however no prior knowledge of name lookup or function overloads is required.
---

Mateusz Pusz

Mateusz Pusz is 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. C++ consultant, trainer, conference speaker, and evangelist focused on Modern C++. His main areas of interest and expertise are code performance, low latency, stability, and security.

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++ training 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. In 2013 Mateusz won “Bench Games 2013” – worldwide competition in the C++ language knowledge.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

Simulating Low-Level Hardware Devices in Cpp – Ben Saks – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Simulating Low-Level Hardware Devices in C++ - Ben Saks - CppCon 2022
https://github.com/CppCon/CppCon2022

When developing software that will interact directly with hardware, embedded developers often find it more convenient to use simulated hardware rather than real hardware. Early in the project, the real hardware may still be under development. Later, using simulated hardware lets us avoid potential overhead costs of cross-development (e.g., uploading the program to the real hardware). Moreover, it’s often difficult to test error-recovery code for errors that occur only rarely; using simulated hardware, we can sidestep this problem by cppcon.digital-medium.co.uk/tag/programming/">programming it to emit a failure signal consistently.

A simulator in C++ can mimic actual hardware remarkably well. In this session, we’ll show you how to use operator overloading, user-defined conversions, and other C++ features to simulate not just complete hardware devices, but individual hardware registers. With this approach, the code that interacts with simulated device registers can be nearly identical to the code that interacts with real hardware.
---

Ben Saks

Ben Saks is the chief engineer of Saks & Associates, which offers training and consulting in C and C++ and their use in developing embedded systems. Ben represents Saks & Associates on the ISO C++ Standards committee as well as two of the committee’s study groups: SG14 (low-latency) and SG20 (education). He has spoken at industry conferences, including the C++ and System Software Summit, the Embedded Systems Conference, NDC Techtown, and CppCon, where he’s also chair of the Embedded Track and a member of the program committee. Ben previously worked as a software engineer for Vorne Industries, where he used C++ and JavaScript to develop embedded systems that help improve manufacturing productivity in factories all over the world. He’s also a contributing author on multiple Vorne patents.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

Using Modern C++ to Revive an Old Design – Jody Hagins – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Using Modern C++ to Revive an Old Design - Jody Hagins - CppCon 2022
https://github.com/CppCon/CppCon2022

In 1984, Dennis Ritchie introduced what would become the Unix System V STREAMS framework, which was designed to provide a way to implement most of the OSI stack with small, testable, modular, protocol independent, reusable, loosely coupled, components. These are great ideals for writing complicated data processing software systems. Unfortunately, the official STREAMS framework itself is limited to kernel modules, and the design itself has fallen out of favor due to perceived performance (and legal) issues. Still, the aforementioned characteristics of the STREAMS design are highly desirable.

This talk leverages features of modern C++ to offer a slightly different take on this relatively old, but very useful, design. We will present the design goals in detail, and show how to build small, testable components that can be easily plugged together.

Furthermore, we will discuss, and then use, several metacppcon.digital-medium.co.uk/tag/programming/">programming techniques to demonstrate how these design goals can be implemented, while also providing optimal runtime performance. For example, one point of performance problems with the traditional design is based on passing messages that contain opaque data. Each module must inspect each message to determine if it will be processed, or ignored and passed to the next module. This design provides an incredible amount of flexibility, but with it comes some amount of runtime cost to possibly perform inspection of every message at every module. One goal will be to utilize modern C++ techniques to reduce or eliminate this runtime cost.
---

Jody Hagins

Jody has been cppcon.digital-medium.co.uk/tag/programming/">programming in C++ since the 1980s. His formal education was in artificial intelligence, using LisP and Smalltalk. His professional experience began as a unix kernel developer, then telecoms, then automated trading, which is where he has been since the 1990s. He added enough C++ support to be able to write kernel modules in C++. Currently, he uses C++ in the domain of financial data feeds.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

Optimizing Binary Search – Sergey Slotin – CppCon 2022

  • Lobby
  • Tag Archives: softwareengineering

https://cppcon.org/
---

Optimizing Binary Search - Sergey Slotin - CppCon 2022
https://github.com/CppCon/CppCon2022

People generally don’t get very excited over 5-10% performance improvements in some databases. Yes, this is what software engineers are paid for, but these types of optimizations tend to be too intricate and system-specific to be readily generalized to other software.

Instead, the most fascinating showcases of performance engineering are multifold improvements of textbook algorithms: the kinds that everybody knows and deemed so simple that it would never even occur to try to optimize them in the first place. These optimizations are simple and instructive and can very much be adopted elsewhere — and they are surprisingly not as rare as you would think.

In this talk, we will focus on one such fundamental algorithm — binary search — and discuss several ways of making it faster using branchless programming, memory layout optimization, and SIMD instructions, and eventually develop an algorithm that is up to ~15x faster than std::lower_bound.
---

Sergey Slotin
Sergey Slotin is the author of Algorithms for Modern Hardware (en.algorithmica.org/hpc).
---

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

#cppcon #programming #binarysearch

Filed under: UncategorizedTagged with: , , , , ,