Solving problems "Inside Out"

submited by
Style Pass
2024-07-06 17:30:02

Usually we think "Outside In", and that is the right way to solve problems most of the time. In outside-in approach we first take decision on most significant questions and then the lesser significant questions. For instance, if you have to go from one city to another, here is a pseudo code for that: function travel(source_city, destination_city) { mode_of_travel = find_mode_of_travel(source_city, destination_city); if (mode_of_travel == "air") { book_air_ticket(source_city, destination_city); do_web_checkin(); call_cab_to_airport(); get_boarding_pass(); check_in_luggage(); clear_security(); eat_pricey_stuff_at_airport(); plane = board_the_plane(); plane.wait_while_in_air(); alight_from_plane(); } else if (mode_of_travel == "train") { book_train_ticket(); call_cab_to_railway_station(); eat_affordable_stuff_at_platform(); train = board_the_train(); train.wait_while_train_travels(); alight_from_the_train(); } else if (mode_of_travel == "run") { wear_shoes(); run(); } }

The above makes sense: we think about more signficant variables first (i.e. what is the mode of travel) and then we think about less significant variables (details of travel in that mode of travel).

Leave a Comment
Related Posts