4 ms·
Terrible advice. It's the exact opposite of "Tell, don't ask". Performance of an if-statement and for-loop are negligent. That's not the bottleneck of your app
by Mystery-Machine 1y ago
Terrible advice. It's the exact opposite of "Tell, don't ask".
Performance of an if-statement and for-loop are negligent. That's not the bottleneck of your app. If you're building something that needs to be highly performant, sure. But that's not the majority.
https://martinfowler.com/bliki/TellDontAsk.html https://martinfowler.com/bliki/TellDontAsk.html
- achernik 1y agoconsider his another post in somewhat similar spirit: https://tigerbeetle.com/blog/2024-12-19-enum-of-arrays/ https://tigerbeetle.com/blog/2024-12-19-enum-of-arrays/ the author is indeed working in a performance-oriented niche
- eapriv 1y agoPerformance of any given CPU instruction is negligible, yet somehow they accumulate to noticeable values.
- drob518 1y agoAmen.
- hello_computer 1y agoHe’s giving object oriented design the medal for cache locality’s victory.