You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2016/12/02 15:35:58 UTC

[jira] [Commented] (LANG-1272) Array shuffling

    [ https://issues.apache.org/jira/browse/LANG-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15715420#comment-15715420 ] 

Gilles commented on LANG-1272:
------------------------------

bq. I think there is no harm in having two variations in different components, which serve different needs.

I don't quite understand. Do you have examples of use that show how the needs could be different?

From the code management POV, there is always an urge to worry whenever there is duplication, especially inside the same project, especially when human resources are scarce.
There could be practical reasons for some duplication, though in all cases, I think that the advantages and drawbacks must carefully weighted (with a bias toward "no duplication"!). And the decision should be documented, with a reference to the alternate implementations (that might be in fact be more suited to the user who could have discovered this code "by chance").

Anticipating the likely reply... :)
No,  I don't think that "no dependency" is a good reason for _"human"_ duplication, given the alternatives:
* BC policy (as quite strictly applied in "Commons" projects)
* "shading" (i.e. _automatic_ duplication)

For example, with the latter, a bug reported to the project that uses the shaded project, will likely be reported upstream, so that _both_ user communities will benefit.

bq. use Java's Random class and err on the side of simplicity.

I think that you confuse (as I did) "simplicity" with "habit".
I was *shocked* to discover that using {{java.util.Random}} is a very bad habit!
Being at the forefront in many programming endeavours, Apache projects should (IMO) drive the change, even if it means to convey bad news.

> Array shuffling
> ---------------
>
>                 Key: LANG-1272
>                 URL: https://issues.apache.org/jira/browse/LANG-1272
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Emmanuel Bourg
>            Priority: Minor
>             Fix For: 3.6
>
>
> I'd like to suggest the addition of methods in ArrayUtils shuffling the content of an array (Objects or primitives). This would be similar to the {{java.util.Collections.shuffle()}} methods.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)