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*
- 5What is the principal difference between passing tens of parameters hidden in a struct and passing them explicitly?Ruslan– Ruslan2017-07-13 08:03:40 +00:00Commented Jul 13, 2017 at 8:03
- 21@Ruslan Cohesion.abuzittin gillifirca– abuzittin gillifirca2017-07-13 08:26:43 +00:00Commented Jul 13, 2017 at 8:26
- 9And you are more likely to refactor the function into smaller functions, since you can just pass along one parameter to the sub-functions instead of tens of parameters. And less risk of mixing up the parameters if you use positional arguments.Hans Olsson– Hans Olsson2017-07-13 12:20:41 +00:00Commented Jul 13, 2017 at 12:20
- 8That's fine, but you have to ensure coherence in the Structs - make sure that the parameters grouped into a Struct are 'related'. You might use more than one Struct under some circumstances.Andrew Dodds– Andrew Dodds2017-07-13 12:22:53 +00:00Commented Jul 13, 2017 at 12:22
- 8@abuzittingillifirca You do not get cohesion automatically. If the only justification for putting parameters in a struct is to pass them to a particular function, then the cohesion is probably illusory.sdenham– sdenham2017-07-13 16:17:23 +00:00Commented Jul 13, 2017 at 16:17
| Show 16 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you