Novactive / NovaCollection

Collection implementation that wraps regular PHP arrays.
MIT License
9 stars 3 forks source link

RFC: mutable and immutable collection #16

Open anaelChardan opened 7 years ago

anaelChardan commented 7 years ago

IMHO, it's quite difficult to remember which function is mutable and which function is not

It could be nice that Collection can be split into MutableCollection and ImmutableCollection with the same name in functions (due to an interface contract).

Plopix commented 7 years ago

we discussed that. we have decided not do it. Forcing the selection of MutableCollection or ImmutableCollection might not be the "PHP way". We could play with traits and have Collection and ImmutableCollection. We could reconsider, it is a good subject.

anaelChardan commented 7 years ago

Yes, I know, but I'm always frustrated as I don't the name of functionnal methods when it is mutable. When we come from Java world or Scala world, we're aware about that :) http://docs.scala-lang.org/overviews/collections/overview.html. And it is better to separate them as they have not the same purpose.