Undefined Behavior is Awesome

Talk
Tue 13:30 - 14:15
You don't need a laptop
Panoramic 2
C/C++

Summary

Undefined behavior (UB) is one of the features of C++ that is both loved and hated. Every C++ developer cares about performance, which is why it is very important to understand what the compiler can optimize and what are the language guarantees. Many times programmers are too optimistic about what the compiler can optimize, or they waste time optimizing code by hand.

In this talk you will learn:

– what is the “as-if” rule

– why compilers know less than the programmer — the main problem with Translation Units

– why compilers optimize based on UB, but don’t warn about it

– why Undefined Behavior can transcend time, removing your whole code without running 88mph

– why having a more constrained language is better — optimizations that you can’t do in C

 

Leave a Reply