Hacker News new | ask | show | jobs
by pjmlp 616 days ago
The Java isms were C++ best practices in C++ GUI frameworks before Java was even an idea, there is even a famous book about them.
1 comments

- GUI frameworks work with an order of 10 or 100 long lived widgets. Number crunchers work on the order of millions of values that exist for a few cycles

- would anybody recommend you should reach for C++ to write Java style OOP in 2024?

- Best practice according to who?

First of all, it is C++ OOP style, Java cloned C++, not the other way around.

Secondly, all major surviving C++ GUI frameworks are still using the same style.

Best practice according to well known folks in the computing industry, with more impact than any of us will ever have on our lifetimes.

I think the main point here is that while this style might make sense for a GUI framework it's not so great for a numerical library like this.

For example: my library is really slow.

And instead of blaming OOP, have you actually used a profiler?
Are you suggesting that many individual allocations and virtual dispatch are not impactful, or just advocating use of a profiler?

Once again, the context of this thread is someone taking an interest in C++ to write fast autodiff code.