optimal java experience

https://lemmy.ml/post/2105561

optimal java experience - Lemmy

I know the guy meant it as a joke but in my team I see the damage ā€œacademicā€ OOP/UML courses do to a programmer. In a library that’s supposed to be high-performance code in C++ and does stuff like solving certain PDEs and performing heavy Monte-Carlo simulations, the guys with OOP/UML background tend to abuse dynamic polymorphism and write a lot of bad code with lots of indirections and many of them aren’t aware of the fact that virtual methods and dynamic_cast’s have a price and an especially ugly one if you use them at every step of your iterative algorithm. Like the guy in the meme I certainly wouldn’t want to have someone in my team who was molded by Java and UML diagrams.

Depends on the requirements. Writing the code in a natural and readable way should be number one.

Then you benchmark and find out what actually takes time; and then optimize from there.

At least thats my approach when working with mostly functional languages. No need obsess over the performance of something thats ran only a dozen times per second.

I do hate over engineered abstractions though. But not for performance reasons.

You need to me careful about benchmarking to find performance problems after the fact. You can get stuck in a local maxima where there is no particular cost center buts it’s all just slow.

If performance specifically is a goal there should probably at least be a theory of how it will be achieved and then that can be refined with benchmarks and profiling.