Skip to content

Commit 3835cef

Browse files
committed
Add a clarification on moving parameters into objects
1 parent 59359a8 commit 3835cef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,11 @@ If the function has a single responsibility, consider if you can bundle
380380
some or all parameters into a specialized object that will be passed as an
381381
argument to the function. These parameters might be attributes of a single
382382
entity that you can represent with a dedicated data structure. You may also
383-
be able to reuse this entity elsewhere in your program.
383+
be able to reuse this entity elsewhere in your program. The reason why this is
384+
a better arrangement is than having multiple parameters is that we may be able
385+
to move some computations, done with those parameters inside the
386+
function, into methods belonging to the new object, therefore reducing the
387+
complexity of the function.
384388

385389
**Bad:**
386390

0 commit comments

Comments
 (0)