In a recent post on the Google Testing Blog, the authors present two versions of a function and ask which one is more readable. However, there are some biased elements in the presentation, such as background color bias and ellipsed code. The authors argue that the function on the right is more readable because it avoids mixing levels of abstraction. While the code style on the right may be easier to understand, the left-hand side function with proper explanations is actually more preferable. The post also criticizes the code’s handling of the oven and suggests that the code should take the oven as a parameter and provide an interface to return the box instead of the pizza.
https://blog.separateconcerns.com/2023-09-11-linear-code.html