3 ms·
Writing the code with the assumption that a key will change is on the same level with premature optimization, in my opinion. It might be reasonable to make the
by sidlls 10y ago
Writing the code with the assumption that a key will change is on the same level with premature optimization, in my opinion.
It might be reasonable to make the assumption for some keys. In these cases a function taking the data and key as arguments and returning the value is sufficient and appropriate.
Frankly, if the code base is so littered with references to that specific data and key combination it might actually indicate a poor design.
- st3v3r 10y ago"Writing the code with the assumption that a key will change is on the same level with premature optimization, in my opinion." Considering how easy it is, and how often I've had keys change on me, I have to strongly disagree. "Frankly, if the code base is so littered with references to that specific data and key combination it might actually indicate a poor design." That's kinda the point of the article.