How can one make variables inherent to an object or system?
For example, when creating a web browser, each option that is created for the user to have control over (i.e. how a window opens, if downloads start immediately, if a download window opens or not, etc.) must be checked on every single event that involves this object or system using disgusting if-blocks.
Is it possible to make these features inherent to the system, such that they need not be checked again once the configuration has been modified?
(*I may be trying to make a non-constant variable be a constant after it is set, but I'm not sure, because I am still grasping at this concept that popped into my mind and may not make sense due to the nature of computers and how they must check every single thing every single time, which we don't mind so much since they do it all so darn fast.)
This question came to me when I was thinking about ASIC design versus universal computing. Analog systems are naturally faster because they just "are", but at the cost of non-adaptability. We created more univeral models (desktop computers) and higher level languages to allow for this adaptability, but at the cost of speed. The speed reduction is a result of the additional overhead and many other things, one of these many things being constant state checking which is realized in the form of 'disgusting if-blocks'. So I suppose that I am looking for a way to simulate the static analog property in a dynamic system.
I thought of this problem further when I used my arm earlier today: my arm 'just was', and I didn't need to check if it was still attached and functional, or explain to it how to brush my teeth... it just knew! When did I lose you?