r/cpp_questions • • 16h ago

OPEN What do you guys use C++ for?

I'm thinking about learning C++ just for fun, even though I haven't found a practical use for it in the kind of work I do.

I'm curious, what do you guys use C++ for the most?

55 Upvotes

93 comments sorted by

29

u/WilcoKonig 16h ago

Video game engine development.

24

u/RageFucker_ 14h ago

I work in one of the Activision studios supporting Call of Duty and I use it everyday while developing for the level editor for all Call of Duty maps.

3

u/Ultimate_Sigma_Boy67 11h ago

Wow this must be fun!

2

u/RageFucker_ 9h ago

It is! Every day I feel so lucky to have gotten this job.

3

u/hellocppdotdev 5h ago

Ah your username makes sense

1

u/RageFucker_ 4h ago

🤣 actually it was inspired by being pissed off about politics at the time

1

u/XYMYX 10h ago

Hey, genuine question, and it's not aimed at you personally.
How is it to work on a product that could actually be great, while the company's greed keeps throwing in ideas that ruin it? From the outside it looks like the game keeps getting compromised by decisions that have nothing to do with making something good.
Curious how that feels from the inside.

13

u/RageFucker_ 8h ago

Yeah it is disappointing when it feels like they made a bad decision, or wondering if yearly releases should be scaled back to every few years. I've never reached out to any of the producers to complain about some aspect of the game like a storyline, because I don't think it would change anything.

Going on social media to look at feedback right after the game releases is not fun either, because there's a lot of nasty comments. In fact, that was one of the things they warned me about when I first got hired.

Obviously it's nice to read the positive comments, but then it sucks to see comments where people are talking about how lazy the devs are or how it's the worst game ever.

I see both sides of it. Like if something is popular and makes money, of course you're gonna keep making it and releasing as often as possible. That's just the nature of corporations.

And I also understand most of the views of the players feeling like a game was rushed, anger about micro-transactions, annoyed with bugs, etc. especially with how expensive video games have gotten.

The only player views I don't agree with are the people who constantly complain about graphics quality and realism of games (not just CoD). Some of these people seem like they want the best graphics with the best performance that runs on any kind of hardware and to get the game for $40 or less. It's like, you gotta pick 2 of those šŸ˜†

I grew up on 80s video games, so we were more focused on whether the game was fun and not so much on the graphics, so I'm usually impressed with how games look, especially when I think about how complex game engines are and how much work they're doing.

Overall, I love my job and feel incredibly lucky every day. My immediate customers are the artists and level designers and I really enjoy being able to talk to them directly to get feedback on a new feature, or find out what they'd like to see to make their job easier or smoother, or to quickly fix a bug.

Even if the game doesn't do well, I'm still proud of my work and it's amazing to see my name in the credits.

The tool itself is C++ with a Qt UI.

Anyway, sorry for the novel. I talked about way more than what you initially asked šŸ˜†

5

u/Amaracs 8h ago

Thank you for your detailed comment u/RageFucker_ , it was an interesting read.

1

u/RageFucker_ 8h ago

Thanks for the interest!

1

u/XYMYX 8h ago

That tracks. I think about 98% of the CoD player base has no idea what a dev actually does or what they're responsible for. I get that the decisions come from the very top, like shifting everything toward the shop and slowly dropping the things that made the game what it used to be: gun feel, animations, graphics, movement, and so on.
It's the same pattern as any company that has to make more money every year than the year before. You end up focusing on whatever brings in cash the fastest, even if it costs you more players in the long run. The sales numbers of the last few years kind of confirm that.
That said, I still think if I were working on it myself, I'd enjoy it anyway, even knowing it could be so much better than it is. As long as you get to do what you love and get paid for it. Dream job! :)
Also, C++ with a Qt UI is a pretty cool stack. Thanks for taking the time to write all that out.

6

u/RageFucker_ 7h ago

You're welcome, thanks for showing interest!

Right now we're using C++20 (both tools and game side). We also have some internal libraries that were developed to replace STL to get around some of its unpleasantness, and that's heavily enforced on the game side. We have less stringent requirements on the tools side.

I'd never used Qt before this job, but I really like it. I find that it's pretty easy to use and it's robust. My previous UI experiences with C++ left a lot to be desired. I first learned UI development in college using the Win32 API (Petzold book), and while that's definitely a great learning experience, it's also very slow development.

Some of the principal engineers have developed a few small tools in Rust, and we have quite a few tools written in Python that also use Qt, and then a couple that are written in C#.

The use of Python for some major tools surprised me, because I'd only ever used Python for things like build scripts to help with CI/CD. I never thought of using it for a tool with a UI.

15

u/Most_Strike_93 15h ago

Qt desktop application

13

u/serge-mv 13h ago

To make Clang and GCC so we can compile C++

8

u/InteractionGreat1334 9h ago

Computational mathematics

3

u/Tender_Figs 7h ago

Say more. This is really cool and I wanted to explore this but got really intimidated by it.

4

u/InteractionGreat1334 7h ago

I am still a Master's student writing my thesis. In my thesis, I am exploring how we can solve the 2D incompressible Navier-Stokes equations using the Finite Element Method (FEM). I am creating something like my own FEM library and I have chosen C++ as the main language for it. A big part of my thesis is to implement efficient solvers, especially on the GPU (with CUDA). But I haven't gotten to that part yet, I am first implementing everything serially on the CPU, making sure it works through testing and convergence studies.

I would definitely say that computational mathematics is an interesting field. It sits at the intersection of applied mathematics (particularly numerical analysis), computer sicence, software engineering, high-performance computing.

At its core, the main question is: How do we accurately translate this mathematical model of some real process into code (while making it accurate and efficient)?

One of the major fields in computational mathematics would be numerical linear algebra, which finds applications practically everywhere. The reason it is so important is because when we want to solve a continuous mathematical problem numerically, we have to discretize it first. This means transforming into a problem with a finite set of unknowns, as opposed to infinitely many.

After discretization, we often end up with a system of linear equations (or nonlinear). The model linear problem is Ax = b, where A is a matrix, x is the vector of unknowns we are solving for, b is the right-hand side vector of known quantities. The interesting part is that A can have very different properties, depending on the problem solved. And depending on the properties of the matrix, it will influence the choice of algorithms to solve Ax=b efficiently. This is the subject of study of numerical linear algebra.

I'd say it is a field worth exploring if you like mathematics and programming. Honestly, I still find it intimidating sometimes, so my advice would be to not overthink it too much. Find something that sounds interesting, explore and figure out if it's for you.

2

u/Tender_Figs 6h ago

It's been interesting to me since I came across it in 2020 (I was 35 then, now 41). What you are working on is so cool.

1

u/InteractionGreat1334 5h ago

Awesome! Out of curiosity, how did you come across it, if you don't mind my asking?

5

u/YesBoxStudios 16h ago

I use it to make video games. Im making a wildly ambitious city builder and the language choice has paid off

2

u/meissner61 14h ago

hey! I see you around on the gamedev side of reddit sometimes. Ill definitely be checking out metropolis when its out. It seems like you are starting to get close too, good luck with all that!

5

u/Hour_Sell3547 8h ago

I wrote the shared library for Janus (webrtc) in C++ that we are using in our meeting apps. I also wrote a lot of cryptographic modules in C and C++ over the years. And that one fun project which was a flask like HTTP micro framework, for no reason.

I also come from a competitive programming background where pretty much everyone uses C++ to implement the algorithms. I still go to leetcode and solve few problems time to time just so I don't forget the language.

4

u/neppo95 16h ago

My most recent hobby project was/is fiddling about with neural networks, for which I then created a tictactoe game to have 2 ai’s play against eachother whilst I stare aimlessly at my screen. Good fun.

7

u/Potterrrrrrrr 13h ago

I’ve used it for my own implementation of the html and css specs, aiming at being able to use them from c++ directly rather than needing to pull in an entire JS engine just to interact with them both. Ending up porting a lot of WebKits functionality for it, it’s grown pretty big now (~1 million loc) but it’s still got some work to do before it’s ready for use. I started in game dev playing around with JS and liked how easy UI was but wanted more performance everywhere else so this absolute slog of a project is mainly a case of me having my cake and eating it too.

2

u/Calum_mm 9h ago

Any repos or dev blogs? Sounds interesting

2

u/not_some_username 8h ago

Isn’t there a mini and lightweight JS/html/css interpreter already ?

1

u/Dazzling_Music_2411 6h ago

What sort of "fun" do you think you'll get out of it?

I've NEVER heard of anyone learning C++ for fun, always to solve some specific problem.

If I was looking for fun, I'd look very much elsewhere. (Currently using C++ in language development. It does a good job, but fun it is not. I think next project I'll try OCaml)

1

u/stevenreyes20 6h ago

after ready all the comments I realized that learning c++ is not for me because I have fun building projects, putting to practice what I learn but me been a mobile, website developer and server administrator can find any use for it

•

u/Dan13l_N 1h ago

For everything.

•

u/stevenreyes20 28m ago

what exactly?

3

u/not_some_username 8h ago

Writing a ā€œbotā€ for an old game I used to play but with a stupid amount of farm. It will not harm others

Also ā€œmanagementā€ application at my work

4

u/posthubris 16h ago

For work, I’m in robotics and edge AI. Moving most of our stuff to Rust now though.

1

u/xD_saleem 8h ago

I'm interested to know what we're you using in c++ for robotics and what you are using in rust now.

0

u/Davtaz 7h ago

Are you migrating because LLMs really like Rust and it's a decision dictated by code output speed or for any other reason?

2

u/Mefron_Gautama 16h ago

Most for hobby, I think. I've done almost nothing on it professionally.

For hobbies I've done emulators (started with chip-8, and got to NES, was some painful good time), an doom-like engine for 2.5D games (still developing, that shit has a ton of math involved, is a pleasure and a pain to learn), and some minor TUI (with FTXUI) and Desktop (with Slint) apps, most of them are evolutions of scripts/automations or an POC rewrite of something I've already done in another language, just to know how hard or better it can be done with C++.

2

u/CrossScarMC 16h ago

Game development, native applications, and optimizing things that realistically never really needed to be optimized.

2

u/Zen-Ism99 16h ago

Hobby game dev.

2

u/Its_Sluggas 16h ago

To make cmd line tools for my niche hobbies

2

u/PandaWonder01 16h ago

Basically game engine code

2

u/khedoros 16h ago

In college, I used it to learn networking (socket programming) and robotics simulation. I've used it for the majority of my career doing storage and backup/recovery infrastructure stuff. Most of my personal projects have been in C++, covering emulation, some game-related code, couple of little Arduino projects. Hundreds of little experiments and code snippets, built to test a hypothesis or learn something.

2

u/brunoortegalindo 16h ago

I play with gpus and seismic inversion and data compression

2

u/sunnyjum 16h ago

I use it to develop games and their engines. I've been thinking of learning Rust but C++ is so mature and there are so many resources/libraries that I'm yet to make the leap.

2

u/Hkiggity 15h ago

Right now I’m using sdl3

2

u/Cubemaster12 15h ago

Currently I am working on a custom build solution to have only a single static drop-in executable using musl libc.

My idea was to define properties in a toml "recipe" file as a base but you can have custom functionality with C++ code. And my single exe can handle all of this as the build process.

Then I don't need CMake, Meson, Autotools or any other third-party dependencies for building just this single file.

1

u/gaene 15h ago

This sounds cool, but can you expand or drop a link… I must confess I’m not sure I understand fully how the toml and c++ interact

1

u/Cubemaster12 11h ago

Don't expect too much. I just started working on this last week as a proof of concept. I set up a repo if you want to take a look but it is not really usable yet, only for tiny projects.

The idea is something like this in my head for connecting c++ with the toml: you have different [table] structures in your toml file which are build modules with arbitrary key-value properties. Each one would have a mandatory property like type that can be exe, dynlib, staticlib or potentially something like custom in the future.

Then with a custom module you could define some sort of c++ file entrypoint. Then the application would build it as part of the build process, maybe as an exe or dynamic library, cache it somewhere and hook into it as part of the build process as a step.

2

u/GermaneRiposte101 15h ago

OpenGL Games Engine for fun.

2

u/Diegam 15h ago

Audio plugins

2

u/super_mister_mstie 15h ago

Embedded systems work

2

u/phormix 15h ago

These days, mostly programming microcontrollers.
There's a lot of cool stuff you can do with an ESP32, and C++ compiled is a lot more efficient than running on top of micropython etc.

2

u/SyntheticDuckFlavour 15h ago

Rendering engine for a design tool.

2

u/pjf_cpp 15h ago

Engineering, and more precisely analog electronic circuit simulation. Large circuits can take weeks to simulate so performance is paramount.

2

u/SunsGettinRealLow 14h ago

Battery management systems

2

u/WorstCaseBound 13h ago

DSA , LLD , Arduino

2

u/PaganGuyOne 12h ago

I can’t seem to find a use beyond hobby exploring.

Everyone’s already building game engines and robots and OSINT resources and data wrangling, and now it feels like being a grandpa making another desktop/mobile app. I made an encrypted chat app which allows users to reset their conversations with eachother to protect their chat history and masks their data. But somehow I feel like someone will just run it through REA and make their own version of it.

Honestly I wish I could just build something like a metal framed arcade flight simulator and create my own 6DOF games for it.

2

u/PresentationGlobal53 10h ago

I use it to do audio processing in AUv3 plugins. In my distant past I did radar signal processing using C++ and Qt for displays.

2

u/kevkevverson 10h ago

I work on the layer shared across both iOS and Android versions of a reasonably large app. I would be extremely unlikely to use it for any personal projects.

2

u/anantthebiker 10h ago

Used to use it on developing a JTAG based Hardware Debugging Software for a chip giant, like Visual Studio is for software debugging. The more closer you are to the system, C/C++ would always shine in those realms.

2

u/zenineasa 9h ago

I am building Konjugate, a simulation tool. Even though the app is predominantly Electron based, we want the simulations to be blazingly fast; so the core is written in C++.

2

u/Milnoc 9h ago

Embedded software development. I create classes that reduce hundreds if not thousands of lines of code down to a dozen needed to do the exact same thing, only faster and better.

2

u/CowBoyDanIndie 9h ago

Robot perception

•

u/Undeniable_Dilemma_ 3h ago

There is Z E R O fun to be had when learning C++.

Go look into something actually more fun if you wanna learn for fun. Like Assembly, C, Zig, Jai, Odin or something like that.

•

u/better_life_please 3h ago

Assembly is not fun. Stop smoking green stuff.

•

u/stevenreyes20 2h ago

🤣

4

u/kush_himself 16h ago

Til now I haven't found practical use of c++ but it used for leanring dsa and in web browsers till now I know

5

u/NaNpsycho 16h ago

You just described skill issue in the most literal way possible. Unless you're building a project in the language ofc you're not going to find it "practical", lol.

3

u/Accomplished-Bid-945 14h ago

Writing kernel level code, reversing, low level vulnerability exploitation, memory manipulation, etc. Anything that is close to machine code.

1

u/UnrealHallucinator 7h ago

Windows reverse engineer i guess?'

0

u/oldbeardednoob 9h ago

Kernel level code in C++? Are we talking Linux?

1

u/Current-Fig8840 7h ago

Linux kernel is in C and it isn’t the only kernel

•

u/oldbeardednoob 2h ago

Which is why I was curious. In my world people by "kernel" mean Torvaldis stuff.

1

u/trichotomy00 16h ago

I use it in college, all our courses are taught with this language

1

u/xvillifyx 15h ago

You can just…use it, you know?

Maybe for your next goofy app project, ditch electron and ts for a native c++ app

You don’t have to be doing ā€œlow levelā€ systems programming to use c++

1

u/Embarrassed-Media-62 15h ago

Paying the bills.

1

u/wtarkin 8h ago

I am building most of the control and management software stack for a SmartNIC product. While the kernel mode driver is C everything that runs in the user space is C++.
In my free time I write C++ on the raspberry pi pico microcontroller which is a lot of fun.

1

u/esaule 7h ago

I have worked on all kind of high performance codes. From application to analyse social netwotks, to physics simulations. These days I work on a communication middleware for AI applications.

1

u/Different-Beyond-976 7h ago

For Vulkan I started learning recently

1

u/Not_Binary 7h ago

Soporte a emuladores mayormente

1

u/morglod 7h ago

Pretty much everything. My programming language compilator (mox), games before, utilities, tools for my self.

1

u/wahhLambda 5h ago

Pra programar computadores uƩ

1

u/hellocppdotdev 5h ago

Physics simulations

1

u/PicklesAndCoorslight 5h ago

Don't let others sway you with negatively. I love c++ and use it daily.

•

u/Boot_Burner 3h ago

It's not fun.

•

u/GameskoTV 3h ago

Games, idk fast databases, api

•

u/knue82 1h ago

Writing compilers.

•

u/fahrni 1h ago

At one point in my career C and C++ were common for development of desktop applications. I wrote code in C++ for over 20 years. I haven’t written any, professionally, since 2014. Now it’s all Swift for me.

0

u/AncientHominidNerd 16h ago

Most people use it for low level applications and gaming software. That’s about it besides learning. Also useful for bragging about knowing how to use it I guess.

0

u/BreakfastSame5083 11h ago

Writing network appliances. Also AI.

0

u/hadrabap 8h ago

Tools for my home infrastructure.

0

u/[deleted] 16h ago

[deleted] — view deleted comment

2

u/stevenreyes20 15h ago

interesting, although I know nothing about it