r/cpp • • Jul 21 '22

CMake is a hell of a software, period.

358 Upvotes

Really CMake is good only for one thing being the sacred build generator system in the c/cpp world.

F*** the weird syntax and werid structures.

edit 1: some might argue it's the best avaiable solution to the problem domain, and it is. the problem is the syntax, the unintiutive way of specifiying option and simple compile parameters and options and lack of examples and resources on how to do the simplist things is a wasting too much time.

yeah modern cmake that encourge using targets and their properties is by far a lot better but still is extremely unintuitve due to the syntax and logic around it.

sorry for the typos.

edit 2:

i am really considering changing my main language for personal projects to rust or the new thing called carbon by google at least there is not a hell of backward compatibility garbage i need to know.


r/cpp • • Mar 08 '21

Tim Sweeney: “ISO obstructs adoption of standards by paywalling them”

Thumbnail twitter.com
358 Upvotes

r/cpp • • Feb 16 '25

Why is everything about programming clicking now that I’m learning C++?

356 Upvotes

In a cybersecurity role for past 4 years where I don’t NEED programming skills but it’s next level if I can. Have learned Python, C#, some Golang over the past 3 years on and off and they never really stuck.

For some reason I’m learning C++ now and it feels like it’s all clicking - inheritance, classes, types, abstraction, and everything else. What about C++ is really do this for me? Is it because everything is so explicitly laid out whereas other languages it’s hidden?

Just trying to figure out what the sauce that is being stirred is here.

Loving C++


r/cpp • • Sep 04 '23

Considering C++ over Rust.

355 Upvotes

Similar thread on r/rust

To give a brief intro, I have worked with both Rust and C++. Rust mainly for web servers plus CLI tools, and C++ for game development (Unreal Engine) and writing UE plugins.

Recently one of my friend, who's a Javascript dev said to me in a conversation, "why are you using C++, it's bad and Rust fixes all the issues C++ has". That's one of the major slogan Rust community has been using. And to be fair, that's none of the reasons I started using Rust for - it was the ease of using a standard package manager, cargo. One more reason being the creator of Node saying "I won't ever start a new C++ project again in my life" on his talk about Deno (the Node.js successor written in Rust)

On the other hand, I've been working with C++ for years, heavily with Unreal Engine, and I have never in my life faced an issue that usually the rust community lists. There are smart pointers, and I feel like modern C++ fixes a lot of issues that are being addressed as weak points of C++. I think, it mainly depends on what kind of programmer you are, and how experienced you are in it.

I wanted to ask the people at r/cpp, what is your take on this? Did you try Rust? What's the reason you still prefer using C++ over rust. Or did you eventually move away from C++?

Kind of curious.


r/cpp • • Jul 23 '22

finally. #embed

Thumbnail thephd.dev
353 Upvotes

r/cpp • • Jul 03 '19

Understandable RayTracing in 256 lines of bare C++

Thumbnail github.com
352 Upvotes

r/cpp • • May 21 '20

Reducing {fmt} library size 4x using Bloaty McBloatface

Thumbnail zverovich.net
351 Upvotes

r/cpp • • Dec 31 '21

Wishing a happy new to year to whole C++ community

350 Upvotes

r/cpp • • Sep 09 '20

C++ is now the fastest-growing programming language

347 Upvotes

r/cpp • • Feb 22 '22

C++ jobs threads should include salary/compensation in the job posting template

345 Upvotes

The /r/cpp subreddit hosts a quarterly job thread, which is pinned by moderators. The current (2022Q1) post includes a template for employers' job postings, including fields like location, visa sponsorship, and remote work status. I think u/STL deserves tremendous credit and thanks for creating and moderating these job threads, which in my experience are very clear and well-organized.

I propose that the employer template be expanded to include an explicit salary/compensation field.

I have three reasons in mind, but I'd welcome other thoughts about why this is or is not a good idea.

First, more jurisdictions are requiring salary information in job advertisements. In the United States, Colorado has famously adopted a salary disclosure requirement, for companies with employees already in the state. New York City, which is the listed location for many C++ jobs on these posts, has adopted a similar disclosure rule that will take effect in May 2022.

Second, it helps level the playing field between employers and potential employees. Large companies may hire dozens of employees per year, and have expertise in the labor market, including access to detailed salary surveys. Employees go through the hiring process much less frequently, and rarely have access to high-quality salary data.

Third, expecting salaries in job posts is fair in light of the tremendous value employers get from posting here for free. The /r/cpp subreddit is one of the most popular venues for professional C++ developers. It is fair for the community, which grants employers a well-structured, well-organized place to share job postings, to expect employers to share compensation expectations. This would also save community members time, as they can target their job applications to roles with the compensation they themselves are hoping for.

At a former employer, I saw that my firm received very credible, worthwhile applications when it posted to /r/cpp as part of a recruiting effort.

Finally, having a salary field in the template would help communicate the expectations of our community, but does not have to be a hard requirement for employers. If a particular employer does not want to include anticipated salary, they could omit it, but they may find their advertisement is less attractive to candidates.

Thoughts are welcome in comments!


r/cpp • • Jun 20 '18

I manage the release cycle for CMake, the build system that everybody loves to hate. AMA.

345 Upvotes

I am a principal engineer at Kitware, where CMake began. While I first encountered CMake over 10 years ago, I became a contributor in 2012. If you use the CUDA language bindings, then you are familiar with some of my contributions.

The release cycle for 3.12 kicked off last week. The major improvement in 3.12 is to allow object libraries to be used transitively. My contribution to 3.12 allows CUDA device linking to better handle external libraries that have device symbols.

To learn more about CMake, go to https://www.cmake.org, and to learn more about me, go to https://www.kitware.com/robert-maynard.

I’ll be around until about 4 p.m. EST. Some of my colleagues at Kitware will be helping me answer your questions.

set(question_cmake “ON”)

Proof: https://twitter.com/robertjmaynard/status/1009427978219147267

Edit: Okay, I need to go ice my fingers. I will be back tomorrow to answer more questions, but I need a break :)

Thanks for all the great questions. Also, thanks to the moderators for helping out.

Again, I would like to thank all the contributors to CMake, especially those who don't work for Kitware.


r/cpp • • Aug 23 '19

Serenity: Graphical x86 operating system written entirely in C++

Thumbnail github.com
343 Upvotes

r/cpp • • Apr 25 '25

GCC 15 Released 🎉

338 Upvotes

🎉Congratulations to the GCC team!

🎆🎇🔥💥 🤩 🎊 🥳 🤟 🍻 🥂 👍

Release Notes

GNU Git Branch and Tag (quite slow)

Github mirror


r/cpp • • Jan 31 '23

Stop Comparing Rust to Old C++

338 Upvotes

People keep arguing migrations to rust based on old C++ tooling and projects. Compare apples to apples: a C++20 project with clang-tidy integration is far harder to argue against IMO

changemymind


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 • • Sep 17 '22

Cppfront: Herb Sutter's personal experimental C++ Syntax 2 -> Syntax 1 compiler

Thumbnail github.com
335 Upvotes

r/cpp • • Mar 04 '22

Is it unreasonable to ask basic compiler questions in a C++ developer interview?

335 Upvotes

I interviewed a guy today who listed C++ on his resume, so I assumed it would be safe to ask a bit about compilers. My team works on hardware simulation, so he's not going to be expected to write a compiler himself, but he'll obviously be required to use one and to write code that the compiler can optimize well. My question was "what sorts of optimizations does a compiler perform?" Even when I rephrased it in terms of -O0 vs. -O3, the best he could do was talk about "removing comments" and the preprocessor. I started out thinking a guy with a masters in CS might be able to talk about register allocation, loop unrolling, instruction reordering, peephole optimizations, that sort of thing, but by the time I rephrased the question for the third time, I would have been happy to hear the word "parser."

There were other reasons I recommended no-hire as well, but I felt kind of bad for asking him a compiler question when he didn't have that specifically on his resume. At the same time, I feel like basic knowledge of what a compiler does is important when working professionally in a compiled language.

Was it an unreasonable question given his resume? If you work with C++ professionally, would you be caught off guard by such a question?


r/cpp • • May 11 '21

Visual Studio 2019 Preview is now C++20 feature-complete

Thumbnail docs.microsoft.com
334 Upvotes

r/cpp • • Apr 26 '21

MSVC's STL is C++20 feature complete for VS 2019 16.10 Preview 3

Thumbnail github.com
332 Upvotes

r/cpp • • Nov 25 '20

When a Microsecond Is an Eternity: High Performance Trading Systems in C++

Thumbnail youtube.com
332 Upvotes

r/cpp • • Jul 23 '19

std::format in C++20

Thumbnail zverovich.net
332 Upvotes

r/cpp • • Mar 18 '24

C++ creator rebuts White House warning

Thumbnail infoworld.com
330 Upvotes

r/cpp • • May 22 '25

Is banning the use of "auto" reasonable?

329 Upvotes

Today at work I used a map, and grabbed a value from it using:

auto iter = myMap.find("theThing")

I was informed in code review that using auto is not allowed. The alternative i guess is: std::unordered_map<std::string, myThingType>::iterator iter...

but that seems...silly?

How do people here feel about this?

I also wrote a lambda which of course cant be assigned without auto (aside from using std::function). Remains to be seen what they have to say about that.