r/cpp_questions

Is c++ gonna have a good job market in the future?

AI rn isnt the best at c++ and although you cant hope that it stays bad forever but i was wondering if the job market was gonna be ok in the future for c++

i wanna keep learning graphics programming and hope it might get me a job one day

sorry if this post sounds dumb, idk what to do with my life

reddit.com
u/Many_Difficulty_490 — 5 days ago

Why clang and libcxx recieve so little contribution from the companies

Progress there is so incredibly slow, they don't even have full C++23 coverage at trunk and we are at the end 2026, so that's what? a 4 year old gap. Don't companies want better qol?

reddit.com
u/Copronymus09 — 3 days ago

I want to learn how to write C++ for work.

Nice to meet you. It’s been 10 years since I first started working with C++, but since I haven’t been able to land a job, my experience is limited to hobby projects. How can I write good code?

I suppose, unlike code written for work, hobby code is only meant to be understandable to the person who wrote it. How is that different from professional work?

I enjoy using libraries like raylib, dxlib, and SDL3.

I’d like to learn the techniques for preventing code from becoming a “spaghetti mess” in a professional setting.

I’ve looked up a lot of this on Gemini, but I’d like to hear some human opinions.

Translated with DeepL.com (free version)

u/amagi77 — 4 days ago

Having trouble making sense of for cicles that are in a for cicle.

Im a First year CS student in Italy, the professor the other day proposed us and exercise of printing a * pyramid. I couldnt solve It in time and felt so stupid.

Especially when he showed us the answer and It was a for cicle that had Two others in It. The way they work together seems so complicated.

Now im at home trying to figure out a code that requires me to concert a binary Number in decimal, i suppose i gotta use something similar but i cannot figure It out.

reddit.com
u/xeriax51 — 5 days ago

googletest: Test project /home/andrew/x86/win32/p2pClient/buildNo tests were found!!!

I coded this p2p client application with librats and now I want to test it with googletest but after running ctest into the build directory I got this exception:

Test project /home/andrew/x86/win32/p2pClient/build

No tests were found!!!

My cMakeLists.txt:

cmake_minimum_required(
VERSION
 3.14)
project(p2pClient)


# GoogleTest requires at least C++17
set(
CMAKE_CXX_STANDARD
 17)
set(
CMAKE_CXX_STANDARD_REQUIRED
 ON)


include(FetchContent)
enable_testing()
FetchContent_Declare(
  googletest
  URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)cmake_minimum_required(VERSION 3.14)
project(p2pClient)


# GoogleTest requires at least C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


include(FetchContent)
enable_testing()
FetchContent_Declare(
  googletest
  URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)

and this is the result after running cmake -S . -B build:

cmake -S . -B build

-- The C compiler identification is GNU 16.2.0

-- The CXX compiler identification is GNU 16.2.0

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working C compiler: /usr/bin/cc - skipped

-- Detecting C compile features

-- Detecting C compile features - done

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++ - skipped

-- Detecting CXX compile features

-- Detecting CXX compile features - done

CMake Warning (dev) at /usr/share/cmake-4.3/Modules/FetchContent.cmake:1386 (message):

The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is

not set. The policy's OLD behavior will be used. When using a URL

download, the timestamps of extracted files should preferably be that of

the time of extraction, otherwise code that depends on the extracted

contents might not be rebuilt if the URL changes. The OLD behavior

preserves the timestamps from the archive instead, but this is usually not

what you want. Update your project to the NEW behavior or specify the

DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this

robustness issue.

Call Stack (most recent call first):

CMakeLists.txt:10 (FetchContent_Declare)

This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done (0.3s)

-- Generating done (0.0s)

-- Build files have been written to: /home/andrew/x86/win32/p2pClient/build

reddit.com
u/Entire-Comment8241 — 4 days ago

Correct way to test async code?

Lets say I have async code or some sort of timer or scheduler that calls a lambda later on some event, how do i test this in simple way in existing frameworks?

Is using futures or other sync mechanism the only way? or a simpler runloop/eventloop style facilities exist in test frameworks to simplify things?

For now looks like the test itself has to take on more theeading/orchestration/synchronization responsibilities.

For event driven and interactive apps, async execution would be common.

reddit.com
u/IndividualSituation8 — 4 days ago

How was I supposed to figure this out on my own?

Not really sure if this matters, but for context I’m currently a CS Master student, was not able to get job or internship after graduating in May 2025. I consider myself a pseudo beginner, where I feel like I know stuff, but also not really.

I am working through CodeCrafters projects because I lack project ideas, and I started with the Build your own HTTP Server. I learned the POSIX sockets API from a book and a LinkedIn Learning course and multithreading stuff (threads, mutex, condition variables, thread pool) from my coursework (although that was POSIX threads API and in C). When I started after the first stage or second stage, I realized I literally did not know how to do anything and all the knowledge from learncpp was if it never existed. I ended up asking Claude a LOT of questions on how to do things or even giving it my own ideas and it saying basically your ideas are trash, let’s do this way instead. I was manually typing out the code and asking lot of questions trying to understand why this way, or why this logic, or whatever else I didn’t understand. Honestly Parsing was especially tough, and Claude did guide me through a lot of it, and I was able to complete the project. I did feel like I learned through this experience, but unsure if I actually did learn because of Claude doing a lot of the work. I at least for sure know I learned how to parse strings in C++.

Anyways, I decided for the next project (Redis) that I would try to not or limit my Claude use, at least for the coding portion, maybe I’d ask it some theory questions. I was utilizing the asio library that was added as a library in the starter code. As one may know, when you do a recv in socket programming, it’s not guaranteed that all the bytes in the tcp stream will come with one recv, so you have to continuously loop until either the client closes the connection or there is something that signifies that this is the end of the request sent. In asio, there is a function async_read_some that does this with a buffer you pass in, and you’ll have to continuously loop, but there is not really a delimiter that signifies the end of the request in RESP bulk string. I figured out the parsing for the bulk string, so now I needed a way to know if I had an incomplete request or not, and how I would do this. I mulled over it for two days looking for something on the internet (maybe I’m just bad at googling or asking the right question?), but I couldn’t really find what I’m looking for, or perhaps my level of understanding was not good enough to understand the various stack overflow posts or articles I’ve read. Eventually I asked Claude and it told me that I needed to use the errors as values pattern, and showed me how to do it with std::expected. When I saw the code it made sense, but I didn’t think about using this pattern at all because well I just didn’t know. I’ve seen it before in one book, but the example program accompanied with it was a toy program that didn’t really have any significance. This is my first time actually utilizing and applying this pattern. When I saw the code it also made my terrible parsing function more modular and better. My question is, how was I supposed to figure it out? Maybe other people might’ve been able to do it without AI use, and I’m just not that smart, but I genuinely don’t know how I would’ve reached that conclusion and that implementation on my own.

Sorry for all the huge paragraphs, maybe I gave more than necessary, I just wanted to make sure the context was there.

reddit.com
u/RandStringsAndChar — 5 days ago

Web service

Which (fairly simple) C++framework would you recommend for a simple http server that binds to a hard-coded port and does a simple listen, read, write shebang on a server? We don't need nothing fancy or complex, we just want to avoid that native Linux sockets APIs boilerplate coding.

reddit.com
u/No-Locksmith-7719 — 4 days ago

Is React really the best frontend choice for C++ applications?

Hi everyone!

I'm an experienced software engineer, mostly working in C++ on the backend side. Frontend isn't my area of expertise, so I'd love some outside perspective.

I occasionally work with developers who build GUIs in Qt. Whenever the topic of frontend tech comes up, they tell me Qt is garbage and that our projects would be much better off with React, since it's free and more modern.

The thing is, I don't have the frontend knowledge to judge that claim. In particular, I can't compare the performance of the different frontend options (Qt, React, and others) in any meaningful way, so I don't know whether "React is better" holds up or is just a subjective opinion.

So my question is: which framework is actually better, Qt or React, especially when it comes to performance?

Real-world experience is more useful to me than hype, so feel free to share what you've seen on your own projects.

Cheers!

reddit.com
u/SheSaidTechno — 10 days ago

Interface design - money

Working on design of a finance app to calculate npv (net present value) need to use addition / multiplication/ pow

I could do with decimal type for money as floats/doubles are based on binary

I see there is fixed point decimal paper being worked on.

In the meantime - what is best way to handle this in interface ?

Thinking of asking client to use string and then use long long for the maths after parsing (pennies)? “1500.23” = 150023

What do I return ? String/int? Either way the client would need to transform. I can’t use doubles for this unfortunately.

I suppose I can use double if could give idea to client what error amount is - npv is estimate anyway.

reddit.com
u/nelson_fretty — 11 days ago

What is the ideal way to read a C++ book?

I am an intermediate c++ dev. I recently started reading the Effective modern c++ book. I don’t have tons of experience reading technical books coz I have mostly used YouTube and college lectures to study. So any advice on how to read a c++ book or any technical book for that matyet is highly appreciate.

reddit.com
u/Shreyansh-t — 11 days ago

What Career paths for C++ in Australia?

Hi everyone, I'm currently in my first year of uni studying computer science in Australia.

What are the career paths you can take by learning C++?

I'm trying to learn C++ as my first language, where can this language take me career wise?

reddit.com
u/NinjaWithAGun96 — 10 days ago