[FFmpeg-devel] [PATCH 4/6] avutil/bprint: use AV_BPRINT_SIZE_AUTOMATIC instead of 1

Nicolas George george at nsup.org
Fri Jun 26 13:46:34 EEST 2020


Soft Works (12020-06-26):
> Isn't it a clear benefit to have a named constant where the name
> of the constant indicates a meaning while a plain number does not?

No. If you know the API enough to use it properly, then the meaning of 1
is obvious. If you don't, the meaning of the constant is obscure.

"Avoid magic constants" is not an absolute commandment to apply with
dogmatism, it is a rule of thumb to apply with intelligence. Like the
ban of gotos.

If this was new code, then maybe it would be slightly better to use the
named constant. But so slightly that the time you wasted just writing
this mail is enough to nullify it. And this is not new code.

Seriously, stop wasting time on useless pseudo-cosmetic changes.
Building ffmpeg.c produces a full page of warnings. These are a few
orders of magnitude more annoying than a magic 1.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200626/c392d66d/attachment.sig>


More information about the ffmpeg-devel mailing list