GitHub user prashantv opened a pull request:
https://github.com/apache/thrift/pull/624
Use enums instead of multiple boolean arguments
Multiple boolean arguments in a function call leads to unreadable code.
E.g
```cpp
generate_deserialize_field(out, &felem, true, "", false, false, false,
true, true);
```
vs
```cpp
generate_deserialize_field(out, &felem, true, "", NOT_IN_CLASS,
NO_COERCE_DATA, NOT_IN_KEY, IN_CONTAINER, USE_TRUE_TYPE);
```
The compiler will ensure you cannot pass the wrong type (e.g.
`NOT_IN_CLASS` where `IsOptional` is required).
There are no functional changes in this patch.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/prashantv/thrift enums
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/624.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #624
----
commit 68e4643237eafcea19c97d17c23cccf9c862fdd9
Author: Prashant Varanasi <[email protected]>
Date: 2015-09-24T06:40:42Z
Use enums instead of multiple boolean arguments
Multiple boolean arguments in a function call leads to unreadable code.
E.g
generate_deserialize_field(out, &felem, true, "", false, false, false,
true, true);
vs
generate_deserialize_field(out, &felem, true, "", NOT_IN_CLASS,
NO_COERCE_DATA, NOT_IN_KEY, IN_CONTAINER, USE_TRUE_TYPE);
The compiler will ensure you cannot pass the wrong type (e.g.
NOT_IN_CLASS where IsOptional is required).
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---