From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1372D469719 for ; Mon, 12 Oct 2020 16:34:28 +0300 (MSK) From: "Timur Safin" References: <33039bab-b31e-0da7-359d-dbbc8464aa55@tarantool.org> <20201012103707.kzx54ljqq67eazrc@tkn_work_nb> In-Reply-To: <20201012103707.kzx54ljqq67eazrc@tkn_work_nb> Date: Mon, 12 Oct 2020 16:34:23 +0300 Message-ID: <1c4a01d6a09c$65f2c680$31d85380$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Tarantool-patches] [PATCH v2 05/15] lua: don't raise a Lua error from luaT_tuple_new() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Alexander Turenko' , 'Vladislav Shpilevoy' Cc: tarantool-patches@dev.tarantool.org The hottest discussions are always about silly style preferrences, and here I couldn't resist to not get involved as well... : From: Alexander Turenko : 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