Y
Hacker News
new
|
ask
|
show
|
jobs
by
Jyaif
2760 days ago
You'd never see `v.resize(10, 42);` because 10 and 42 would be in self-documenting variables, e.g.
```
int kDefaultValue = 42;
size_type kExpectedSize = 10;
v.resize(kExpectedSize, kDefaultValue);
```
1 comments
wyldfire
2760 days ago
...though in this case it's still the reviewers job to help understand what the code does and if the reviewer doesn't know for sure which arg comes first then they still can't easily check that the code does what's intended.
link
AstralStorm
2760 days ago
The guide should then specify some common instances where arguments may be flipped.
link