Date: Sun, 15 Nov 2015 10:10:37 -0800 From: Garrett Cooper <yaneurabeya@gmail.com> To: Allan Jude <allanjude@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: libXO-ification - Why - and is it a symptom of deeper issues? Message-ID: <2DF061E9-2541-4B10-9744-C49C515FF672@gmail.com> In-Reply-To: <5648C964.2020405@freebsd.org> References: <0650CA79-5711-44BF-AC3F-0C5C5B6E5BD9@rdsor.ro> <5648C964.2020405@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Nov 15, 2015, at 10:05, Allan Jude <allanjude@freebsd.org> wrote:
>=20
>> On 2015-11-15 07:54, Dan Partelly wrote:
>>=20
>> Hi all,
>>=20
>> I was looking at the new facility of dumping JSON,XML from many utils in b=
ase and after some funny minutes, I couldn't stop ask myself =81g Ok, this i=
s funny , but why ? =81g And I couldn't find a real answer. Ill outline what=
 I think:
>>=20
>>=20
>> 1. Undoubtedly, it makes base code slightly harder to understand and main=
tain.
>=20
> I am not sure that libxo actually makes the code any harder to
> understand and maintain. It might actually make it slightly better.
>=20
> replacing:
>=20
> printf("%s %s %d\n", foo, bar, number);
>=20
> with:
>=20
> xo_emit("{:foo/%s} {:bar/%s} {:number/%d}", foo, bar, number);
>=20
> it not really hurting much.
That's by and large true, but there are other APIs that need to be called on=
 exit (xo_finish?) and in other scenarios where flushing, etc is needed. If y=
ou don't do that, you don't get the output you expect (which broke uptime/w s=
everal months ago..).
Also, typos with the meta language into the xo_emit calls have bit is more t=
han once ;(.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2DF061E9-2541-4B10-9744-C49C515FF672>
