r/cpp • • 3d ago

I don’t even hate AI, I just feel a little sad about being obsolete

694 Upvotes

I felt cool and smart that I understand low level programming, pointers and memory management and all that stuff. I still program for fun as a hobby but if I start thinking about this stuff I lose my momentum. I like to write my code like an engineer and I am very specific about how I write it. I think AI has good uses for the future but it just makes me sad to think about how anyone can AI generate code and it makes my deep understanding not as cool anymore. My projects matter less, anyone could just instantly generate the code for the game I spent years on. I’m not special anymore nor are my projects. It’s just a little sad. I think about C++26 and C++29, is anyone even going to care about these things anymore with the obsolescence of people who use these features by hand… idk. I get in ruts like this someone and I just have to ignore it. I want to hear everyone else’s opinions especially ones who are very opinionated about programming features and care about their code very much like I do.

Sometimes though I think about ways I program that an AI wouldn’t do, such as my excessive and opinionated use of unsigned integers with explicit cstdint types and the lowest possible bit amount for the variable, while AI will just use standard int. Another one is how I try to avoid dynamic allocations whenever possible, even for silly things like microoptimiaztions, for file paths I’ll do a 4096 stack buffer over dynamic allocation. Makes me feel like I have somewhat of a voice.


r/cpp • • Jan 07 '26

I got paid minimum wage to solve an impossible problem using C++ (and accidentally learned why most algorithms make life worse)

Thumbnail tiespetersen.substack.com
617 Upvotes

I was sweeping floors at a supermarket and decided to over-engineer it.

Instead of just… sweeping… I turned the supermarket into a grid graph and wrote a C++ optimizer using simulated annealing to find the “optimal” sweeping path.

It worked perfectly.

It also produced a path that no human could ever walk without losing their sanity. Way too many turns.

Turns out optimizing for distance gives you a solution that’s technically correct and practically useless.

Adding a penalty each time it made a sharp turn made it actually walkable:

But, this led me down a rabbit hole about how many systems optimize the wrong thing (social media, recommender systems, even LLMs).

If you like algorithms, overthinking, or watching optimization go wrong, you might enjoy this little experiment. More visualizations and gifs included!


r/cpp • • Apr 15 '26

YAY!!! Announcement: cppreference.com update

Thumbnail isocpp.org
523 Upvotes

This is not my post, but I didn't see anyone share this here yet.


r/cpp • • Aug 20 '26

AI-generated C++ passes tests. It also uses nearly 2x the loops and drives up memory growth

Thumbnail leaddev.com
444 Upvotes

AI-coding tools have swept through organizations because of their speed: you type in a prompt, and it spits out code far faster than a human ever could. However, a year-long study of 3.52 million changes inside a large unnamed technology company suggests that saving time at the keyboard can create costs elsewhere.


r/cpp • • Jun 05 '26 Popcorn

The Story of C++: The World's Most Consequential Programming Language | The Official Story

Thumbnail youtu.be
430 Upvotes

r/cpp • • 28d ago

Dealing with AI Slop At Work

392 Upvotes

I work at a C++ shop with coders that I really respected - very deep C++ knowledge and are building very technical deep systems products. Over the last few months the CTO has gone off the deep end with AI talking of creating software factory (He’s been reading too much X), he releases huge multi thousand line PRs with basically no review. All sense of scientific temperament and engineering rigour has gone out of the window it seems.
I do believe that AI is a transformational tool and I use it plenty in the development process but I still strive to understand what the AI has written and often use the AI as multiplier rather than surrendering my thinking to it. it’s become increasingly hard to actually develop while deeply understanding the codebase because it has become so sloppy.

I am very sad as this means I’m not really interfacing with writing C++ as much and exploring cool new corners of the language in my daily work.

There is definitely some cool stuff this lets us do a bit more of - high level planning and systems design by reading many papers as well as exploring formal verification.
But overall I am left disappointed. I wonder how it is like at everyone else’s work places and if anyone has any thoughts and suggestions on how I can still develop my C++ knowledge.


r/cpp • • Jan 15 '26

Support for C++26 Reflection has been merged into GCC trunk!

Thumbnail gcc.gnu.org
385 Upvotes

Shout out to Marek Polacek and Jakub Jelínek for their herculean effort to get this done!

Still some bug-bashing ahead for them, so don't be surprised to find some examples from P2996 and friends that don't work yet - but know that it's being worked on!


r/cpp • • Dec 31 '25

Software taketh away faster than hardware giveth: Why C++ programmers keep growing fast despite competition, safety, and AI

Thumbnail herbsutter.com
380 Upvotes

r/cpp • • May 31 '26

The lost art of creating good desktop apps.

335 Upvotes

Hello everyone I am a novice C++ developer. I would like to learn how to create good desktop applications in C++. Don't you think it's a lost art? All the applications that I use every day were created a long time ago (for example, 7zip, wireshark) And it doesn't really look like we're creating something like this today.

I would really like to learn how to create something like this and would like to hear your advice (I am especially interested in creating applications that somehow process incoming data and then output it in real time)

A few of my thoughts:

  1. It seems that to create applications of this level, you need to be very well familiar with the operating system internals, and not only in the C++ language.
  2. Many good applications have closed source code and we simply cannot study it, and for those applications where the code is open, it has already been written hundreds of thousands of lines, it is difficult to understand this and identify the "architectural core".
  3. Many recommend "just take Qt". That's good advice (is it good?) but this is only the smallest part of the job. I think it's right to divide applications into layers and a display layer (which is why we use Qt) doesn't look too complicated. Yes, I know that the Qt ecosystem represents almost everything that is needed, but I would like to separate the UI layer and the Core layer of the application so that I can quickly change the UI layer if necessary.
  4. Multithreaded model, we don't want the application to lag and generally want responsiveness speed. That's what I have the most questions about.

r/cpp • • Dec 20 '25

5hrs spent debugging just to find out i forgot to initialize to 0 in class.

304 Upvotes

Yup, it finally happened.

I am making a voxel terrain generation project to learn OpenGL. It was my abstraction of vertex arrays. Initially, when I created this class, it generated an ID in the constructor, but then when I introduced multithreading, I needed to stop doing that in the constructor (bad design, I know—need to study design patterns). So I introduced a boolean to initialize it when the first call to Bind() is made. But I didn't set it to false at that time. I saw chunks rendering, but there were gaps between them. So I started debugging, and honestly, the VertexArray class wasn't even on my mind. I just printed the VAO values in the output along with some other data. Although the values were somewhat random, I ignored it because OpenGL only guarantees unique unused values, not how they're generated. But then in the middle, I saw some were small and continuous like 1, 2, ..., 10. Then I put a print statement in the Generate() function of VertexArray and realized it wasn't even being called.

Yup, that's my rant. And here's the ugly code I wrote:

cpp

class VertexArray {
   public:
    explicit VertexArray(bool lazy = false);
    ~VertexArray();
    
// Returns the vertex array ID
    GLuint id() const { return array_id_; }
    void   Generate();
    
// Binds this vertex array
    void Bind();
    void UnBind();
    
// Adds and enables the attribute
    void AddAttribute(Attribute attribute);

   private:
    GLuint array_id_{};
};

r/cpp • • Mar 29 '26

C++26 is done! ISO C++ standards meeting, Trip Report

Thumbnail herbsutter.com
302 Upvotes

r/cpp • • Sep 07 '26

A faster way to convert a timestamp ➜ Hour, Min, Sec

Thumbnail benjoffe.com
298 Upvotes

r/cpp • • 23d ago

For the first time, a C++ standard failed to pass the national bodies

Thumbnail herecomesthemoon.net
294 Upvotes

r/cpp • • Jun 25 '26

oh GOD, it's good to come back to C++

292 Upvotes

Just been going around vanilla javascript, php, perl, LUA, some C#, batchscript over and over for a year but finally came back to C++ and it's good to be home.

To some they find it agonizing with memory management, consts, function prototyping and what not.. some wouldn't even touch it but to me, it's like riding a bike. It's all coming back and I need that extra control! Besides MySQL.. this is it! 🔥🔥


r/cpp • • Oct 24 '26

Balloting has completed for C++26. Unfortunately it was Disapproved

Thumbnail linkedin.com
289 Upvotes

Since the C++26 DIS has been disapproved, the next step is going to be taken in Buzios during the 2026-11 meeting. The committee will have to decide what changes to make (if any) and submit an FDIS (Final Draft of International Standard) for Balloting.


r/cpp • • Sep 27 '26

You should think about recompiling your C++ programs with GCC 16 and C++26, because it zero-fills your locals

Thumbnail techfortalk.co.uk
270 Upvotes

Stack variables are not automatically initialised, and that is the root cause of many C++ bugs. That is well known. Hence, it is advised that local or stack variables are always initialised with known values, 0 if not something more meaningful than that. Now, with GCC 16 compiling in C++26 mode (-std=c++26), even uninitialised local variables will be zero-filled. In the post, I have explained how.


r/cpp • • 13d ago

C++26 is done (again)! — Trip report: November 2026 ISO C++ standards meeting (Búzios, Brazil)

Thumbnail herbsutter.com
263 Upvotes

Herb's usual trip report


r/cpp • • Apr 30 '26

GCC 16.1 released with many new C++26/23 features, C++20 now the default stable language version

Thumbnail gcc.gnu.org
263 Upvotes

r/cpp • • Aug 02 '26

How fast is C++26's std::hive?

Thumbnail lemire.me
255 Upvotes

r/cpp • • 21d ago

CMake 4.5.0 released; supports import std for all scannable targets with C++20 and later

Thumbnail kitware.com
254 Upvotes

r/cpp • • Jan 02 '26

Every LLM hallucinates that std::vector deletes elements in a LIFO order

251 Upvotes

r/cpp • • 4d ago Bravo

Pattern Matching for C++29

Thumbnail mpark.github.io
249 Upvotes

r/cpp • • Apr 14 '26

A year of read-only cppreference

248 Upvotes

Over a year ago (on 30 March 2025), cppreference became read-only for maintenance reasons. Since then, the only progress update was in August. There have been several discussions here in the last few months about what is happening with cppreference and when it might become editable again, but from what I understand, we simply do not know.

At this point, I fear that the lack of updates for what is basically the authoritative source on the language (other than the standard of course), linked to by IDEs and even this subreddit's sidebar, might be detrimental to the adoption of C++26 and further standards, should the situation persist. I would therefore like to ask the community whether there are other, more up-to-date resources, and whether there is any effort to, for example, fork cppreference.

I understand that software updates are complicated and I have no intention to criticise the maintainers of cppreference (who are doing it voluntarily and I am not entitled in any way to their continued work on the website), but I do not think the C++ community can afford to be bottlenecked in such a way for much longer.


r/cpp • • Jan 29 '26

Cache Explorer: a visual and interactive profiler that shows you exactly which lines of code cause cache misses

243 Upvotes

Built a visual cache profiler that uses LLVM instrumentation + simulation to show you exactly which lines cause L1/L2/L3 misses in your C and C++ code (Rust support in active development).

  • Hardware-validated accuracy (±4.6% L1, ±9.3% L2 vs Intel perf)
  • Source-level attribution (not just assembly)
  • False sharing detection for multi-threaded code
  • 14 hardware presets (Intel/AMD/ARM/Apple Silicon)
  • MESI cache coherence simulation

It's like Compiler Explorer but for cache behavior, providing instant visual feedback on memory access patterns. MIT licensed, looking for feedback on what would make it more useful or even just things you like about it.

GitHub