3 ms·
> It's quite a paradox; Java is really fast if you keep allocations down, but Java "best practices" often involve tons of object creation. That's because best
by golergka 4y ago
> It's quite a paradox; Java is really fast if you keep allocations down, but Java "best practices" often involve tons of object creation.
That's because best practices are aimed at a task that is usually more important than performance: correctness and maintainability.
- Diggsey 4y agoYes, but the language would be better if correctness and maintainability were not so at odds with performance.
- UncleMeat 4y agoIt would be different. A large number of real world applications aren't especially performance sensitive and it makes sense to have tools that prioritize other things than performance. We also see how languages that do prioritize performance can suffer in other aspects (C++ is a clear example). I think that this is fundamental in some way. Consider arithmetic. Fixed with integers suck from an ergonomics perspective. But variable-size integers are necessarily slower. Even designing something as basic as how arithmetic will work in your language forces you to consider performance against usability.
- vbezhenar 4y agoIt’s almost always at odds with performance.
- golergka 4y agoAnd databases would be better if consistency and availability were not so at odds with partition tolerance.