Emanuel and all,

I see dependencies here and in other libraries a natural aspect of Java
development in that it helps reuse proven solutions, where bug fixes and
implementations are improved, while externalizing that cost to the library
which is otherwise born by the host code base.

Reusing a library allows the host component to focus more on its business
than having to draw attention from it. The benefits far outweigh any
drawbacks in my view.

In addition, reuse makes the code easier to read, easier to maintain, and
easier to contribute to without getting lost in the weeds of code that's
been copy pasted all over the place.

A mention was made of the size on disk of jar files, this feels immaterial
when a JVM is now very good at only loading the classes it needs out of a
jar file.

HTH,
Gary

On Fri, Nov 1, 2024, 5:53 PM Emmanuel Bourg <ebo...@apache.org> wrote:

> Le 01/11/2024 à 20:04, Gary Gregory a écrit :
> > Emanuel,
> >
> > -1 you are duplicating code (again) as a one-off while adding the clutter
> > of a ternary expression (and unnecessary parentheses). It is much cleaner
> > to use canonical-like code from our low level Commons IO library we
> already
> > use elsewhere. There is no benefit to expanding this API call. This
> change
> > forces the reader to parse out the ternary expreasion, the how, instead
> of
> > focusing on the what of the method.
>
> Gary,
>
> There are 4 other ternary expressions in the ZipFile class, 90+ in the
> zip package and over 270 in the whole code, not counting the unit tests.
> Some of these expressions were added by you this year, in commits
> labeled "Use ternary expression" [1][2][3]. So I conclude that it's
> acceptable to use this syntax.
>
> The extra parentheses improve the readability in my opinion, but I don't
> mind removing them.
>
> Expanding the API call is necessary to remove the undesired dependency
> on Commons IO.
>
> Emmanuel Bourg
>
> [1] https://github.com/apache/commons-compress/commit/bbe6fd9a
> [2] https://github.com/apache/commons-compress/commit/aa71cb93
> [3] https://github.com/apache/commons-compress/commit/b3e34e89
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

Reply via email to