JEP-476 module import considered harmful

Cristian Mocanu cvmocanu at gmail.com
Tue Nov 19 15:28:15 UTC 2024


Hi Archie,

Thanks for your reply.

> In this case, just because (a) Java enables a coding practice you don't
like doesn't mean (b) you have to tolerate it in your own organization
Indeed, it can seem that way, but in reality it doesn't work well. In
reality, I have to maintain code written by devs who don't work at the
company anymore for a long time. They left a mess of a code behind, and in
the case of undesirable language features, they did it because they could.

Kind regards,
Cristian


On Tue, 19 Nov 2024 at 16:12, Archie Cobbs <archie.cobbs at gmail.com> wrote:

> I'd like to throw out a note of hope...? :)
>
> I think there is a reasonable debate about whether star imports are "good"
> or "bad" but from the POV of language design that debate is made almost
> entirely moot thanks to the robust ecosystem of style checkers.
>
> In other words, this is, in effect, just a policy decision that your
> particular organization can enforce, just like other style preferences such
> as whether to allow switch case fallthrough, whether to require curly
> braces around a one-line if/else branch, etc. If you don't like star
> imports, then have them cause your build to fail. Problem solved!
>
> In this case, just because (a) Java enables a coding practice you don't
> like doesn't mean (b) you have to tolerate it in your own organization. The
> (a) and (b) are two separate issues with two separate debates and two
> separate resolutions.
>
> -Archie
>
> On Tue, Nov 19, 2024 at 8:38 AM Pedro Lamarão <
> pedro.lamarao at prodist.com.br> wrote:
>
>> Em ter., 19 de nov. de 2024 às 11:09, Cristian Mocanu <cvmocanu at gmail.com>
>> escreveu:
>>
>>
>>> Knowing that code is being read many time more often than written, I
>>> don't think it makes sense to optimize writing an import by hand (which no
>>> one does anyway - the IDE writes it for us) to the detriment of introducing
>>> confusion when reading the code outside an IDE (like a GitHub PR review).
>>>
>>
>> Optimizing Java for GitWeb-like readers does not seem to me the way
>> forward.
>> GitWeb-like products are themselves moving toward "AI powered web IDE"
>> status.
>>
>> --
>> Pedro Lamarão
>>
>
>
> --
> Archie L. Cobbs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20241119/ab3fb1a9/attachment.htm>


More information about the amber-dev mailing list