[Tarantool-patches] [PATCH v4 1/4] util: introduce strlcpy helper

Cyrill Gorcunov gorcunov at gmail.com
Fri Dec 11 14:38:12 MSK 2020


On Fri, Dec 11, 2020 at 02:07:53PM +0300, Serge Petrenko wrote:
...
> > 
> > n.b. You know every time I see `if (x != [0|NULL])` statement
> > it driving me nuts: the language standart is pretty clear for
> > `if ()` statement and explains how it is evaluated and I always
> > wonder who exactly invented this explisit test for non-zero/nil?!
> > Now *every* if statement requires 5 additional symbols for simply
> > nothing :( I suspect the person who started to use this form
> > simply was not aware of the language standart.
> 
> I guess it's more about code readability rather than producing a
> correct expression according to the standard.

Hardly. I suspect it was due to lack of understanding how code
compiles and evaluates, and being nonfamiliar with standarts ;)

> 
> I was also surprised by this rule at first, but got used to it now.
> It's all about what you're used to, after all.

Yeah, not a big deal, I can live with this style as well and try
to follow for sure :)


More information about the Tarantool-patches mailing list