Closed kilrau closed 5 years ago
I've voiced my opinion in related issues but I'll say again.
"List" definitely does not make sense for fetching single objects. So we definitely should not have ListInfo
for example, but also not ListNodeInfo
for a single node.
Using "list" for lists and "get" for single objects is pretty standard I think and consistent with lnd as well as the bitcoind API.
I think the only one that might be worth changing is GetOrders
to ListOrders
- the data format of the response for that call actually changed somewhat recently and now it's basically a list of orders lists. I know @offerm had suggested changing this earlier, so if we want to change that and then stick with "list" for plural and "get" for single then I'm fine with that.
@sangaman @kilrau How should I move forward on this?
Personally, I think we should go for get
but @sangaman has a good point and I agree with him.
What @sangaman describes is Option 2 which is fine with me: only one thing to do: rename GetOrders
to ListOrders
. Let's go with this one and we are in line with our role model lnd
:)
And for future calls we remember the logic @sangaman described: multiple elements/plural like orders or trades: ListX
, one element like info: GetX
.
This issue is about renaming
list
/get
calls in a consistent manner. I know we all have our feelings about this and especially all the renaming. Brought that up because I believe it's still fixable now. Please leave comments.Motivation: Let's analyze it from a new dev/CLI user perspective: it looks inconsistent how we use
get
andlist
e.g.getOrders
andlistTrades
. Especially on CLI usage one tends to pick the wrong one.Option 1: All
list
->get
. E.g.listPeers
,listPairs
togetPeers
,getPairs
. I'd go forget
since it's the more generic form and will always make sense for a dev implementing the gRPC. IMO the CLI just represents data it gets from the gRPC/xud in the most suitable form. That might be a list, a table, a JSON or a circle. Good: consistent Bad: differs fromlnd
, renaming effortOption 2: The
lnd
way:get
only for info calls (getInfo
), rest is consistentlylist
. Good: followslnd
Bad: not consistent