What is the difference between optimistic approach and pessimistic approach?

The differences between an optimistic approach and an optimistic approach in decision making The differences between an optimistic approach and an optimistic approach in decision making rely entirely on how the decision-makers assume the organization's effects. When making decisions under uncertainty, the decision-makers have not known the effects and impacts of the decision. An optimistic approach indicates that the decision-makers are hopeful that the outcomes will positively affect the organization. On the other hand, a pessimistic approach indicates that the decision-makers are convinced that the results will negatively affect them. The pessimistic approach allows the decision-makers to prepare for the worst possible outcomes. In the optimistic approach, the decision-makers believe that the chosen alternatives will bring about the best outcomes. In other words, the decision-makers are confident that their choices are the most ideal for the situation. The pessimistic approach is characterized by the decision-makers assuming that the choices made will bring about the most adverse results. Solving problems under uncertainty is typically considered as solving the problem under conditions of risks since the decision-makers can only be optimistic that the outcomes of their decisions will bring positive outcomes. Making decisions under uncertainty means that the decision-makers cannot determine all the factors influencing the decision and its impacts. The failure to predict the possible outcomes of the various decision means that there is no assurance that the decision will not bring about adverse effects. The uncertainty of the outcomes brings about the risk factor when solving problems under such conditions. An optimistic state is that managers try to make decisions in a very delicate situation and come up with many suggestions for positive outcomes. They then choose the best option from the hopefully positive outcomes. On the other hand, pessimistic decision-making is where managers, under the same condition of uncertainty, try to make a delicate decision regarding a particular outcome and choose the worst from the possible bad outcomes (Sharda et al. 2020). References Sharda. R, Delen. D, Turban, E. (2020). Analytics, data science, & artificial intelligence: Systems for Decision Support. Global Edition. Pearson Education Limited. ...

In our current phase with technology, speed is no longer a feature but a requirement. Web developers know that you have on average 15 seconds to capture a user to have them stay on your app. There is even less time to retain a user if there is no content appearing on the screen. The introduction of AJAX requests in development helped alleviate blocking due to undeterminably long requests from our programs, allowing users to interact with the page while those tasks are being done in the background. These changes, however, were not enough, as the rapid adoption of AJAX in code bases shifted from being a feature to becoming the expected standard. This is where Optimistic and Pessimistic approaches come into play.

Optimistic and Pessimistic UI rendering are simply two different approaches to displaying information to the user. While they begin at the same place, the way in which they treat the AJAX request differs. The remainder of this post will explain how these two approaches differ. For an example, I will use the liking feature used in many social media web applications. When a user clicks a like button, the button changes to show that the content has been liked.

Pessimistic Flow

With the introduction of Web 2.0 and AJAX requests, we could make a page more dynamic by rendering specific content after certain events, while doing all of the work in the background. The typical (pessimistic) flow is as follows:

  • A user clicks the like button of a post they like
  • A call is sent to the sever registering the information
  • The server sends back a Response to the page
  • Based off of the Response, the state of the button and page changes

Here is what this would look like in vanilla JavaScript.

As we can see from the code snippet above, the important part to note about the pessimistic approach is it allows us signify changes made by user when we are certain of the the result. Also, because it is an asynchronous request, the user is able to interact with the app while we perform the server calls.

Optimistic Flow

The major downside of pessimistic rendering, and cause of wait time, is the fact that the program has to wait for a response from the server to continue to the rendering. Taking a leap of faith, the optimistic approach solves this by essentially cutting out the middle person. The typical flow is as follows:

  • A user clicks the like button of a post they like
  • The state of the button and page changes

Unlike the pessimistic approach, the optimistic approach does not wait for the server to trigger the event’s success state. Instead, it is optimistic about the success of the server call it will make and acts accordingly. This is because in reality from the standpoint of a developer, the flow is as follows:

  • A user clicks the like button of a post they like
  • The state of the button and page changes based on the click
  • A call is sent to the server registering the information
  • Most of the time, the call will be successful
  • In the off chance the call fails, then say something to the user

Here is what this would look like in vanilla JavaScript.

Here, the user click is immediately sent to a success state and only notifies the user if the server call actually fails.

Ultimately, optimistic approaches give the user more immediate feedback to their input, enabling them to feel more engaged with the web application.

Summary

It is important to note that one approach is is not universally better than the other; each one has their pros and cons. The best case scenario for using optimistic programming is when the actions are akin to simple binary actions where success and failure reactions are expected. However, if the cost of an action is significant, i.e. purchasing tickets or making a bank transaction, it is better to use pessimistic methods to ensure the user is presented the correct information.

What is the difference between optimistic and pessimistic?

An optimistic person sees good things everywhere, is generally confident and hopeful of what the future holds. From the optimist's point-of-view the world is full of potential opportunities. The pessimist, on the other hand, observes mainly the negative aspects of everything around.

What is a pessimistic approach?

A pessimistic attitude isn't very hopeful, shows little optimism, and can be a downer for everyone else. To be pessimistic means you believe evil outweighs the good and that bad things are more likely to happen. So pessimistic people are usually pretty negative.

What is the optimistic approach?

The optimistic approach, also called the maximax approach, involves choosing the option with the largest possible payoff or the smallest possible cost.

What is the difference between optimist pessimist and realist?

An optimist is someone who sees the good and the positive in everything. The pessimist sees the bad and the negative. On the other hand, the realist doesn't mind whether it's good or bad. They only focus on practical things.