close
Skip to main content
Image

r/cpp_questions


How do I avoid writing "Java in C++"?
How do I avoid writing "Java in C++"?
SOLVED

Hi all!

About me: I've started a hobby project (2D game with Raylib) in C++ to learn it. In my job for the last 3+ years I've been coding in corporate banking environment in Java, Kotlin, Typescript (React), occasionally Python.

I've read a lot (but not everything yet) from learncpp, sometimes I use LLMs as ideas generator or for generating specific, single purpose functions. Thanks to it's suggestion I've started learning about ECS pattern (paradigm) thanks to LLM suggestion, I've heard about it in game-dev interviews later.

I'm also strictly following TDD with unit tests that follow classic (Detroit school), so each functionality is checked by starting the engine with given state, simulating input and checking the state after game engine ticks are done.

Now the main question as in title: How do I avoid writing "Java in C++"? I've heard about it being a common occurrence among devs switching languages/tools. LLM will be useless in this problem, because we all know that it will tell me not to worry and that I'm doing good.


What secret about your industry can you share now that you don’t work for them anymore?

Oh boy, where do I even start? After 8 years as an auto insurance agent, I have zero loyalty left to protect these companies.

We Had "Loyalty Lists" Every month, I'd get a report of customers who hadn't shopped around in 2+ years. These were our golden geese - we could raise their rates aggressively because they'd proven they wouldn't leave. One customer I remember was paying $3,200 annually for coverage that should have cost $1,800. She stayed for 5 years.

The "File and Use" Scam Here's something most people don't know: in many states, insurance companies can raise your rates immediately and justify it later. We'd implement 15-20% increases across entire ZIP codes, knowing regulators would take months to review. By then, we'd collected millions in extra premiums.

Claim Frequency Was Irrelevant Your rates weren't really based on how often you'd claim - they were based on how likely you were to shop around. A customer with 3 claims who got quotes every year paid less than a claim-free customer who never compared rates. It was pure price discrimination.

We Loved Policy Confusion Complex policy language wasn't an accident. The more confusing your coverage, the less likely you'd comparison shop effectively. We'd change terminology between companies deliberately to make apple-to-apple comparisons nearly impossible.

The Real Game-Changer Tools like ComparisonAdviser absolutely terrify insurance companies because they eliminate our biggest advantage: information asymmetry. When customers can instantly see what competitors charge with identical coverage and discounts applied, our whole "loyalty tax" model collapses.

I've watched too many good people get fleeced by an industry that profits from customer ignorance. Use ComparisonAdviser religiously - it's the only way to beat a system designed to exploit your trust.

The truth? Every year you don't comparison shop, you're probably donating $500-1,500 to your insurance company's profit margins.


Is Linus Torvalds just a dinosaur about C++?
Is Linus Torvalds just a dinosaur about C++?
OPEN

I have recently started learning C as a hobby and it’s very interesting, but I quickly have begun to understand the thought process that must have lead to C++. Even in simple projects like Tetris and a CHIP-8 interpreter it becomes a little annoying to have a struct, a pointer to that struct, and a separate function that has to include an ‘object’ (I don’t know what you call it in c) of the struct that you have to pass to every function call. One of the reasons I chose C for a language is because of how highly it is praised by the likes of Linus Torvalds, and naturally his less-than-flattering opinions of C++ have become apparent to me. Do you think Torvalds has a point about C++ and OOP in general, at least for his main domain of kernel level code? If not at all, (ie if you think C++ is an objective improvement) do you think it’s worth it to learn C before hand anyway?


How to create modern UI in C++
How to create modern UI in C++
OPEN

Link: https://www.reddit.com/r/hyprland/comments/1ssnh6y/i_was_told_to_post_my_dotfiles_here/

I would like to create something like the above output style. I keep researching about this but only end up reading that there are only a few options like Qt, ImGUI etc.. But since, I am not aware which library would give the most features and make it straightforward to achieve this result, I am asking you all

I wouldn't like to use web as UI that's for sure because that would affect performance in my case. Thank You!

EDIT:

  1. It's also quite surprising that we don't have a standard modern UI library for c++. I mean does microsoft provide one? considering it's their platform

  2. The reason I find it a little hard to utilize the above libraries is: I believe the software will have to built around Qt, which I can't really do. ImGUI whilst good but it's more like a "scaffolding" UI