Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • 1
    Of course, "take out the trash" and "bring in the mail" as the two separate and isolated parts of "do your chores" also perfectly illustrate the cost of abstractions: It removes chances to take advantage of the nitty-gritty details to eliminate wasted work, in this case duplicate running-around. Does the loss of efficiency matter? Only if the numbers say so. Commented Dec 27, 2019 at 2:32
  • Deduplicator true. But that 'wasted work' is clear and obvious. Thus if optimization is required later you know where to find it. Also, if trash day and mail delivery day become different days it's not hard to tease them apart. Commented Dec 27, 2019 at 2:36
  • I appreciate how this answer highlights that naming (or readability) is really the key concept here. The point is not how much your code does but whether it's organized into a clear, traceable line of thought. And, of course, cramming too many lines into a single code block fails to meet that goal. Commented Nov 2, 2023 at 20:06
  • I am struggling to understand para 4 and 5. Please help to understand. Commented Jan 30, 2024 at 13:06
  • 1
    Did you ever find a method name that's neither jarring nor leaks implementation details but still nicely groups the two chores? ;-) Commented Apr 18, 2024 at 8:47