Linked Questions

4 votes
6 answers
10k views

Possible Duplicate: Are there guidelines on how many parameters a function should accept? I have got class with 30 variables (it is an application form), so I wonder what is the best practice to ...
Dracontis's user avatar
  • 211
3 votes
0 answers
547 views

I'm a junior developer learning programming in Python. I found that some of functions I write uses too many parameter, like def f(a,b,c,d,e,g,h): What would one recommend to avoid such a situations? ...
user1678880's user avatar
-1 votes
1 answer
202 views

Is it common to have a constructor with 7 elements for example? or is it better to use many setters instead?
nemo's user avatar
  • 115
23 votes
6 answers
11k views

When writing some functions, I found a const keyword in parameters like this: void MyClass::myFunction(const MyObject& obj,const string& s1,const string& s2,const string& s3){ } often ...
ggrr's user avatar
  • 5,893
17 votes
4 answers
7k views

I have some raw data I need to do many things to (shift it, rotate it, scale it along certain axis, rotate it to a final position) and I am not sure what the best way to do this to maintain code ...
tomsrobots's user avatar
17 votes
4 answers
17k views

In Clean Code, it is written that "the ideal number of arguments for a function is zero". The reasons why are explained and make sense. What I'm after is techniques to refactor methods with 4 or more ...
Neil Barnwell's user avatar
9 votes
2 answers
4k views

according to Are there guidelines on how many parameters a function should accept?, a method should not have too many parameters. However, some answers suggest this issue can be solved by builder ...
ocomfd's user avatar
  • 5,760
5 votes
2 answers
676 views

I have a problem related to this: Are there guidelines on how many parameters a function should accept? In my case, I have a function that describes a rounded rectangle. The caller specifies An ...
user877329's user avatar
2 votes
4 answers
597 views

I am working on a Pokemon game at the moment, and am running into some design concerns. The easiest example is as follows: Each Species of Pokemon has several traits that are required before it is ...
Zymus's user avatar
  • 2,543
0 votes
2 answers
128 views

According to Are there guidelines on how many parameters a function should accept?, it is ok for a method to have few parameters. According to https://stackoverflow.com/questions/11240178/what-is-...
ocomfd's user avatar
  • 5,760