Inline Temp ▸ Replace Temp with Query ▸ Split Temp Variable ▸ Remove Assignments to Parameters ▸ Replace Method with Method Object ▸ Substitute Algorithm ▸ Move Method ▸ Move Field ▸ Extract Class ▸ Inline Class ▸ Hide Delegate ▸ Remove Middle Man ▸ Introduce Foreign Method ▸ Introduce Local Extension ▸ Self Encapsulate Field ▸ Replace Data Value with Object ▸ Change Value to Reference ▸ Change Reference to Value ▸ Replace Array with Object ▸ Duplicate Observed Data ▸ Change Unidirectional Association to Bidirectional ▸ Replace Magic Number with Constant ▸ Encapsulate Field ▸ Encapsulate Collection ▸ +40 more… ТЕХНИКИ РЕФАКТОРИНГА 9
index_list: if idx < 100: print(“too small”) continue if not check(idx): print(“check failed”) continue do_method1() do_method2() do_method3() def is_ok(idx): return idx > 99 and check(idx) for idx in index_list: if not is_ok(idx): continue do_method1() do_method2() do_method3()
known as public transportation, public transit, or mass transit) is transport of passengers by group travel systems available for use by the general public, typically managed on a schedule, operated on established routes, and that charge a posted fee for each trip. Examples of public transport include city buses, trolleybuses, trams (or light rail) and passenger trains, rapid transit (metro/subway/underground, etc.) and ferries. Public transport between cities is dominated by airlines, coaches, and intercity rail. High-speed rail networks are being developed in many parts of the world. A ferry is a merchant vessel used to carry passengers, and sometimes vehicles and cargo as well, across a body of water. Most ferries operate regular return services. A passenger ferry with many stops, such as in Venice, Italy, is sometimes called a water bus or water taxi. Ferries form a part of the public transport systems of many waterside cities and islands, allowing direct transit between points at a capital cost much lower than bridges or tunnels. However, ship connections of much larger distances (such as over long distances in water bodies like the Mediterranean Sea) may also be called ferry services, especially if they carry vehicles. Capital costs are ﬁxed, one-time expenses incurred on the purchase of land, buildings, construction, and equipment used in the production of goods or in the rendering of services. In other words, it is the total cost needed to bring a project to a commercially operable status. Whether a particular cost is capital or not depend on many factors such as accounting, tax laws, and materiality.