On Thu, 13 Jun 2019 at 14:15, Gary Gregory wrote:
>
> I like addFirst() and addLast() because these are the same kind of names as
> the existing java.util.List.add(int, E) which should be familiar to people.
>
> I feel that interpreting addFirst() as "add after first" breaks the
> principle of lea
I like addFirst() and addLast() because these are the same kind of names as
the existing java.util.List.add(int, E) which should be familiar to people.
I feel that interpreting addFirst() as "add after first" breaks the
principle of least surprise.
Gary
On Thu, Jun 13, 2019 at 9:03 AM Mark Dacek
addFirst is commonly used with LinkedLists. I wouldn't think it to be
unintuitive.
On Thu, Jun 13, 2019 at 8:56 AM sebb wrote:
> On Thu, 13 Jun 2019 at 13:43, Gary Gregory wrote:
> >
> > On Thu, Jun 13, 2019 at 8:32 AM sebb wrote:
> >
> > > On Wed, 12 Jun 2019 at 22:11, Mark Dacek wrote:
> >
On Thu, 13 Jun 2019 at 13:43, Gary Gregory wrote:
>
> On Thu, Jun 13, 2019 at 8:32 AM sebb wrote:
>
> > On Wed, 12 Jun 2019 at 22:11, Mark Dacek wrote:
> > >
> > > I’d support adding both.
> >
> > +1
> >
> > How about overloading as follows:
> >
> > ArrayUtils.add(T[], T, index)
> >
>
> Ah, I se
On Thu, Jun 13, 2019 at 8:32 AM sebb wrote:
> On Wed, 12 Jun 2019 at 22:11, Mark Dacek wrote:
> >
> > I’d support adding both.
>
> +1
>
> How about overloading as follows:
>
> ArrayUtils.add(T[], T, index)
>
Ah, I see we already deprecated an "add at index" method in favor of
"insert at index":
On Thu, Jun 13, 2019 at 8:32 AM sebb wrote:
> On Wed, 12 Jun 2019 at 22:11, Mark Dacek wrote:
> >
> > I’d support adding both.
>
> +1
>
> How about overloading as follows:
>
> ArrayUtils.add(T[], T, index)
>
> It seems inconsistent to have add() and addFirst(); that suggests
> there should be an
On Wed, 12 Jun 2019 at 22:11, Mark Dacek wrote:
>
> I’d support adding both.
+1
How about overloading as follows:
ArrayUtils.add(T[], T, index)
It seems inconsistent to have add() and addFirst(); that suggests
there should be an addLast()
> On Wed, Jun 12, 2019 at 5:09 PM James Carman
> wrot
I’d support adding both.
On Wed, Jun 12, 2019 at 5:09 PM James Carman
wrote:
> I like it. Seems like a logical thing to do. Another idea would be adding
> at an arbitrary index.
>
> On Wed, Jun 12, 2019 at 5:04 PM Gary Gregory
> wrote:
>
> > Hi All:
> >
> > We have org.apache.commons.lang3.Ar
I like it. Seems like a logical thing to do. Another idea would be adding
at an arbitrary index.
On Wed, Jun 12, 2019 at 5:04 PM Gary Gregory wrote:
> Hi All:
>
> We have org.apache.commons.lang3.ArrayUtils.add(T[], T).
>
> WDYT about adding a method that adds the element at the beginning of t
Hi All:
We have org.apache.commons.lang3.ArrayUtils.add(T[], T).
WDYT about adding a method that adds the element at the beginning of the
new array instead of the end?
Gary
10 matches
Mail list logo