Some rust proponents having this attitude is probably part of the problem.
Some rust proponents having this attitude is probably part of the problem.
I think rust has good ideas and may even become the default systems language in the mid-term. I find it irritating that there is a very vocal subset of rust proponents that tend to insist that every project in every language needs to be rewritten in rust immediately. I suspect that is also why other people are down on rust.
Usually it doesn’t matter what abstractions you choose when you try to factor them to support hypothetical future work, because chances are you incorrectly anticipate future needs.
In other words, generic code that only supports one use case will almost certainly have to be deconstructed to allow a good generic implementation for 2 use cases, so it is better to just write simple code and factor code out when you can see the real commonalities.
In other, other words, KISS, YAGNI
I hate reading code like this. It means that there is a bunch of object or global state that could be getting modified by anything all over the place that I can’t see just by looking at the method. In other words, if you say you understand this method, it is because you are making assumptions about other code that might be wrong.
I’ll take a 30 line pure function over a web of methods changing member state every time.
You can do PGO with GCC, though it takes extra steps of course