We, as human beings, we all are self governed servomechanisms which has a preliminary goal to achieve. To survive and to breed. All the civilizations, the agreements and the order between people is to maximize our possibility to survive, and finally to breed. If we shelter under a bigger force and obey what it orders, we personally know that we would have better chance to survive from predators. Moreover it is wise not to consume a lot of energy for finding food and only focus on survival, by collective approach, saving more energy for breeding makes us successful on our primary duty.
All the software and hardware which are designed to work in set-it and forget-it approach needs some feedback mechanisms for survival. These feedback mechanisms are usually watchdogs and sensors that will control some internal or external parameters and feeds the data to central processors. Central processors processes these kind of data and determines the survival strategy. So for survival, there are two important parts; the feedback system and central processing unit. In the parametric equation, it can be thought that the better feedback system feeds the environment and internal states the higher the possibility of survival, which is also true for processing unit, better it analyzes, higher the chances.
So for a mechanism which have the ability copy itself, having some feedback mechanisms and uses its breeding ability in the direction of the feedbacks. Here we have to think that humanity is the primary machine rather than the individual humans. At the end of the day, all the effort is for creating the ultimate human. Maybe which will not need to breed anymore, or every breed is the exact copy of itself, indestructible and maybe immortal. For developing such machine from a lower model need a lot of effort on evaluating the environmental needs and internal inconsistencies. Which means a better feedback system which is built better than ever. Which our emotions can be this perfect feedback system.
A robot or electronic device, can store a data corresponding to a bad event. However, if there are not very well structured, syntactic clue that points to that storage area, it would not calculate the odds of survival when entering a new environment. These syntactic clues can be placement data, some kind of color, smell etc. However we as human, if we had any bad emotion about something, we sense it at the second encounter. Our emotions give us the perfect feedback to beware of the terrible situation.
Is it really like that? I will search for this question and gather more data on emotion and its feedback role on our goal to survival...