That’s actually a very low price for an anti-air missile. For comparison, the Stinger shoulder-fired missile costs more than twice as much. A Patriot missile costs four million dollars (but is much more capable). Presumably minimizing cost was a high priority when this missile was designed. Nonetheless, the cost asymmetry is one reason why degrading the ability of Hamas and Hezbollah to fire missiles at Israel is important.
My issue with this is that it works well with sample code but not as well with real-world situations where maintaining a state is important. What if
rider.preferences
was expensive to calculate?Note that this code will ignore a rider’s preferences if it finds a lower-rated driver before a higher-rated driver.
With that said, I often work on applications where even small improvements in performance are valuable, and that is far from universal in software development. (Generally developer time is much more expensive than CPU time.) I use C++ so I can read this like pseudocode but I’m not familiar with language features that might address my concerns.