Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Number of Parameter Passed to Function? [closed]

Tags:

c#

I want to know how many parameters can be passed to function, I mean what is good programming practice, regarding passing the parameters to function?

like image 946
Asim Sajjad Avatar asked Apr 01 '10 07:04

Asim Sajjad


1 Answers

Code Complete suggests a maximum of 7. This is because of The Magical Number Seven, Plus or Minus Two:

...the number of objects an average human can hold in working memory is 7 ± 2; this is frequently referred to as Miller's Law.

Here's an excerpt from Code Complete 2nd Edition:

Limit the number of a routine’s parameters to about seven

Seven is a magic number for people’s comprehension. Psychological research has found that people generally cannot keep track of more than about seven chunks of information at once (Miller 1956). This discovery has been applied to an enormous number of disciplines, and it seems safe to conjecture that most people can’t keep track of more than about seven routine parameters at once.

like image 52
Anton Gogolev Avatar answered Oct 06 '22 23:10

Anton Gogolev