"AWS Spellcheck Fail!" alerts Peter "If only someone at AWS knew the correct paramters to activate the spellcheck."
"How long is too long for a job to be open? " wonders Lincoln K. "I didn't even know LinkedIn existed 61 years ago, let alone was accepting postings... Though only 81 applicants in that time is hardly an impressive turn-out." For a "Vice President Operations and Quality Control", no less.
An anonymous Richard reports "This came through my door. On a card that, in order to get to my door, had my full address printed on it, including my ."
Oenophile Abroad Michael R. shares "My Macbook broke after being "exposed" to red wine. As a German in London it pleases me so see that the repair shop offers this time granularity."
GCC 16.1 has been released! Lots of good C++26 material including reflection and contracts.
GCC 16 Release Series: Changes, New Features, and Fixes
From the announcement:
- C++20 by default: [...] N.B. C++20 modules support is still experimental and must be enabled by -fmodules.
- Several C++26 features have been implemented:
- P2996R13, Reflection (PR120775, enabled by
-std=c++26 -freflection)- P3394R4, Annotations for Reflection
- P3293R3, Splicing a base class subobject
- P3096R12, Function Parameter Reflection
- P3491R3,
define_static_{string,object,array} (PR120783)- P3560R2, Error Handling in Reflection
- P1306R5, Expansion statements (PR120776)
- P2900R14, Contracts (PR119061)
- P2795R5, Erroneous behavior for uninitialized reads (PR114457)
- [...]
- Improved experimental C++20 modules support:
- New command line option
--compile-std-modulethat conveniently builds the<bits/stdc++.h>header unit and thestdandstd.compatmodules before compiling any source files explicitly specified on the command line.- Whenever the
<bits/stdc++.h>header unit has been built, GCC now transparently translates an#includeof any importable standard library header into animportof<bits/stdc++.h>.- Many reported bugs have been fixed, thanks to Nathaniel Shead.
- [...]
Runtime Library (libstdc++)
[...]Improved experimental support for [...]
std::mdspan, thanks to Luc Grosheintz.[...]std::simd.std::inplace_vector.[...]
"This WTF is in Matlab" almost feels like cheating. At one place I worked, somebody's job was struggling through a mountain of Matlab code and porting it into C. "This Matlab code looks like it was written by an alien," also doesn't really get much traction- all Matlab code looks like it was written by an alien. This falls into the realm of "Researchers use Matlab, researchers may be very smart about their domain, but generally don't know the first thing about writing maintainable code, because that's not their job."
But let's take a look at some MatLab Carl W found:
try
if (~isempty(fieldnames(bigStruct)) && isfield(bigStruct,'pathName'))
[FileName, PathName] = uigetfile(bigStruct.pathName);
else
[FileName, PathName] = uigetfile(lastPath); %lastPath holds previous path
end
catch
bigStruct = struct;
end
The uigetfile function opens a file dialog box. When the user selects a file, FileName holds the filename, PathName holds the containing path. If the user doesn't select a valid file, or clicks "Cancel", both of those variables get set to 0. It's then up to the caller to check the return value and decide what happens next.
Which is not what happens here, obviously. The developer responsible seems to believe that it maybe throws an exception? And they can just catch it? Carl's best guess is that this is a "weird" way to catch the cancel button. But it does mean that FileName and PathName get set to 0, and those zeros propagate until something finally tries to open those files, at which point everything blows up and the user doesn't know why.
BeCPP Symposium 2026 (organized by BeCPP): Now on YouTube!
Lieven de Cock - Type Punning, the joke is on you, pun intended
Abstract:
Many codebases contain several spots of type punning, and unfortunately a whole lot of those are incorrect and undefined behavior. While many current versions of compilers seem to do the correct thing, they might no longer do that tomorrow. Safety considerations wants to reduce/eliminate UB.
It might be worthwhile to inspect your reinterpret_cast constructs, most probably they are wrong. In this talk we will inspect what is wrong about those, we will learn about alignment, strict aliasing, object lifetime. 3 areas which might flag a red card on our type punning constructions.
Luckily the language evolved and gave us more tools to do it correctly, things like memcpy, memmove, bit_cast, start_lifetime_as, launder. It does however remain a dark corner and a dangerous territory to wander in. Because let's face it, zero copy is something we love in C++, and those bytes that came from the network, really are an array of integers, array of coordinates, ... Compiler, trust me, I know what I am doing. Am I?
About the Speaker:
Lieven is a passionate software developer, architect, team lead, manager, coach, with 30 years of experience. He is passionate about C++, software craftsmanship, and clean code. His career started in the text-to-speech domain and then moved to video recognition technology for traffic environments. During the last 15 years he is active in the satellite communication industry. Lieven also contributes to several open source projects and is the lead developer of the open source IDE Code::Blocks. He is also the lead coach of the Coderdojo division in Ghent, Belgium where he lives. A major focus is on sharing knowledge on C++, coaching people to grow in C++, and maintaining and raising the bar on quality.
From our Anonymous submitter:
Our company creates graphs to visualize data. We have many small fish customers, but we have one whale who uses our product that is 90% of company revenue. (WTF number 1.)
So if he is not happy, it's all-hands-on deck-mode.
He complained that our APIs and charts are loading slowly for him. For 3 weeks, we've tried a TON of optimizations, including WTF 2: spinning up a special server he alone can hit.
Today, we found out that he's always complaining when he's in his car, driving from home to the office. But since he "totally has the best wifi money can buy," that isn't worth investigating.
WTF 3: thinking wifi and data are always 100% reliable in a car driving around.
Our submitter highlights one of the major pitfalls of the so-called whale client: if they're a bad client, you're in for an extra-bad time.
As I lean harder into freelancing, I'm learning to scan the waters ahead of me for potential whales. My goal is to build up multiple small, diverse income streams, because I've had my own dangerous encounters with whales in the past.
At one employer of mine, there was Facebook, who acted as if they were our new owners rather than a new customer. They'd already produced flashy marketing videos of the sorts of solutions they planned to implement with our software, showing people delighted with the results. In meetings, these things were talked up as amazing game-changers. Meanwhile, I found all the things Facebook wanted to do horribly creepy and invasive.
Even worse, Facebook began dictating how our award-winning technical support should change to accommodate their whims, up to and including having a dedicated toady—er, support rep—who did nothing but field Facebook-related tickets, similar to a technical account manager (TAM).
That was the last straw for me. I left that company before I was forced to deal with any of Facebook's crap.
My second whale sighting occurred at a startup that'd landed Porsche, far and away their biggest client ever. All of a sudden, our timeline for adding new features and fixing bugs became Porsche's honey-do list. All of a sudden, the platform frequently crashed and became unusable for everyone because it couldn't handle the amount of traffic Porsche (and their clients) hurled at it.
On the other hand, there were several times in that startup's existence when a big wad of promised funding failed to materialize. Porsche kept the business afloat and literally kept my lights on.
I find it less than ideal to be at any company's mercy. I want a world that would neither spawn whales nor millions of startups named Sploink, Dink, and Twangle that promise to bring the power of AI to your dinner fork.
Have your own epic whaling adventures? Share with us in the comments!
Glaze is a high-performance C++23 serialization library with compile-time reflection. It has grown to support many more formats and features, and in v7.2.0 C++26 Reflection support has been merged!
Glaze 7.2 - C++26 Reflection | YAML, CBOR, MessagePack, TOML and more
From the article:
Glaze now supports C++26 reflection with experimental GCC and Clang compilers. GCC 16 will soon be released with this support. When enabled, Glaze replaces the traditional
__PRETTY_FUNCTION__parsing and structured binding tricks with proper compile-time reflection primitives (std::meta).The API doesn't change at all. You just get much more powerful automatic reflection that still works with Glaze overrides! Glaze was designed with automatic reflection in mind and still lets you customize reflection metadata using
glz::metaon top of whatstd::metaprovides via defaults.
A few years back, C# added the concept of "primary constructors". Instead of declaring the storage for class members and then initializing them in the constructor, you can annotate the class itself with the required fields, and C# automatically generates a constructor for you. It's all very TypeScript and very Microsoft, and certainly cuts down on some boilerplate.
Esben B's team isn't really using them in many places, but they are using a linter which is opinionated about them. So this in-line constructor causes the linter to complain:
public DocumentNetworkController(ILookupClient service)
The linter wants you to switch this to a primary constructor. Esben didn't want to do that, and didn't want to change the global linter configuration, and so added a pragma to disable that particular warning:
#pragma warning disable IDE0290 // Use primary constructor
public DocumentNetworkController(ILookupClient service)
#pragma warning restore IDE0290
The linter didn't like this. It threw a new warning: that this suppression wasn't needed. Which was news to Esben, as clearly the suppression was needed if you wanted to make the warnings go away. The obvious solution was to disable the warning that you didn't need to disable the warning:
#pragma warning disable IDE0079, IDE0290 // Use primary constructor
public DocumentNetworkController(ILookupClient service)
#pragma warning restore IDE0290, IDE0079
Except this doesn't work. These pragmas take effect on the next line, which means you can't disable IDE0079 on the same line as IDE0290 and expect it to work. Which means the final version of the code looked like this:
#pragma warning disable IDE0079 // Disable warning about not needed supression
#pragma warning disable IDE0290 // Use primary constructor
public DocumentNetworkController(ILookupClient service)
#pragma warning restore IDE0290, IDE0079
Esben writes:
So the nice recommendation to use a primary ctor ended up with 3 lines of annoying boilerplate code. Good times \o/
While yes, this is frustrating, I will say there's an element of "when the table saw keeps taking fingers off, that may be more of a you problem." I don't know the details, so I can't say, "just change the linter config or adopt its recommendation" and claim that the problem goes away, but when the tool hurts you, it's a definite sign of one of two things: it's either the wrong tool, or you're using it wrong.
Registration is now open for CppCon 2026! The conference starts on September 12 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2026!
The Wonderful World of Designing a USB Stack Using Modern C++
by Madeline Schneider
Summary of the talk:
Have you ever wondered how to design a library to abstract and manage complex communication protocols like USB? Have you ever wondered which parts of a protocol need to be hardware abstractions and which parts are hardware agnostic? Well you’re in luck, my mentor and I have designed a USB stack from the ground up in modern C++! We found that the public offerings did not meet our needs. Our requirements are:
- Resource efficient
- Portable
- Modular
- Convenient to use
- Distributable via single pre-built binary using conan
- Without allocations after initialization
In this talk you’ll learn the basics of how USB works at the lowest level from a software perspective. You’ll learn why malleability and freedom are so important for USB device development and how C++ makes such a library design easy to implement. Embark with me on a deep-dive into shaping a library where complexity runs wild. This talk will have lessons on library and API design in situations where the degrees of freedom are vast and all parts must magically fit together. By the end, you’ll carry away practical patterns for taming vast design spaces—skills that apply to any ambitious library, far beyond USB.
We rip on PHP a lot, but I am willing to admit that the language and ecosystem have evolved over the years. What started as an ugly templating language is now just an ugly regular language.
But what happens when you still really want to do things with templates? Allison has inherited a Python-based, WSGI application which rejects any sort of formal routing or basic web development best practices. Their way of routing requests is simply long chains of "if condition then invokeA elif otherCondition then invokeB". Sometimes, those conditions will directly set the MIME type on the HTTP response.
They do use a templating library called Mako for generating their responses. They use it for their HTML responses, obviously. They also use it for their JSON responses, generating code like this:
{
"success": true,
"items": {
%for item in items_available.keys():
"${item}": ${items_available[item]}${',' if not loop.last else ''}
%endfor
}
}
The %for and matching %endfor mark the Python code off, which generates JSON via string-munging, complete with the check to make sure we're not on the last iteration of the loop.
Like so much bad code, this offers a degree of fractal wrongness. Instead of iterating over the keys and fetching the items inside the loop, you could iterate for key,value in items_available.items()- and according to the Mako docs, that for is just a regular Python for loop. That we're just outputting the contents of the dictionary is itself potentially a problem- sure, if we know the types of the dictionary, we'll know that whatever it is can be output in the body of a JSON document, but do we really think this code is using type annotations? I don't. And for a RESTful web service, I'm always going to feel weird about using a success field when ideally the HTTP status code could convey most of that information (and yes, I know there are reasons to still put status in the body, I just hate it).
Of course, the real issue is just: Python's built in JSON serialization is actually pretty advanced. And performant! You don't need any of this, you could just do something like:
return json.dumps({"success": true, "items": items_available})
No templates. No formatting. No worries about how the data gets represented. Well, still worries, because JSON serialier will throw exceptions if it doesn't know what to do with a type. But then at least you get that exception on the server side and aren't sending the client a malformed document.
In any case, this is a good demonstration that you can write bad PHP in any language.