You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/07/06 11:38:05 UTC
[GitHub] iilyak commented on a change in pull request #1370: [5/5] Clustered
Purge Implementation
iilyak commented on a change in pull request #1370: [5/5] Clustered Purge Implementation
URL: https://github.com/apache/couchdb/pull/1370#discussion_r200627891
##########
File path: src/couch_pse_tests/src/cpse_util.erl
##########
@@ -183,16 +183,24 @@ uuid() ->
couch_uuids:random().
-assert_db_props(DbName, Props) when is_binary(DbName) ->
+assert_db_props(DbName, Props, Module, Line) when is_binary(DbName) ->
Review comment:
Nitpick (kind of): I would put `Module` and `Line` to be first arguments. The reason is pure esthetics (very subjective). We expect `Props` to be long so it is better to have it as the very last argument. Compare:
```
assert_db_props(?MODULE, ?LINE, DbName, [
{doc_count, 1},
{doc_count, 1},
{del_doc_count, 0},
{del_doc_count, 0},
{update_seq, 2},
{update_seq, 2},
{purge_seq, 0},
{purge_seq, 0},
{purge_infos, []}
]).
```
with
```
assert_db_props(DbName, [
{doc_count, 1},
{doc_count, 1},
{del_doc_count, 0},
{del_doc_count, 0},
{update_seq, 2},
{update_seq, 2},
{purge_seq, 0},
{purge_seq, 0},
{purge_infos, []}
], ?MODULE, ?LINE).
```
On the other hand most of the functions in erlang stdlib don't have this convention. For example all functions in `lists` module has long function definition as the first argument. I guess your version is less surprising to erlang developers. Therefore I propose to keep yours. Unless you think it would be better to change the order.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services