[Tarantool-patches] [PATCH v2 05/15] lua: don't raise a Lua error from luaT_tuple_new()

Timur Safin tsafin at tarantool.org
Mon Oct 12 16:34:23 MSK 2020


The hottest discussions are always about silly style preferrences,
and here I couldn't resist to not get involved as well...

: From: Alexander Turenko <alexander.turenko at tarantool.org>
: Subject: Re: [Tarantool-patches] [PATCH v2 05/15] lua: don't raise a Lua
: error from luaT_tuple_new()
: 
...
: > > +	if (argc != 1 || (!lua_istable(L, 1) && !luaT_istuple(L, 1))) {
: > > +		struct ibuf *buf = tarantool_lua_ibuf;
: > > +		luaT_tuple_encode_values(L); /* may raise */
: >
: > 5. We usually put comments on separate line.
: 
:  | /* May raise. */
:  | luaT_tuple_encode_values(L);
: 
: ...would make unclear whether it applies to just next call or several
: ones. We can wrap the call and the comment with empty lines above and
: below, but it is too much for such small thing. Or we can explicitly
: point to the call in the comment:
: 
:  | /* The next call may raise. */
:  | luaT_tuple_encode_values(L);
: 
: However such comment sometimes displaced by inaccurate commits and
: befomes useless. So we should mention the function name explicitly, but
: it, in turn, looks too tautological.
: 
: I'm aware about the convention, but I still think that one-two word
: remarks are complelety okay to be placed inline. I don't exploit this
: much.
: 
: I'll change it somehow, if it disturbs (and you'll highlight it), but
: personally I think it is okay.

I'm totally with Sasha here - this comment as being put to the right of 
a function it comments on - is the most appropriate usage case, IMVHO.

Regards,
Timur



More information about the Tarantool-patches mailing list