[Cuis-dev] [DEFECT] #copyFrom:count: for OrderedCollections

Jon Raiford raiford at labware.com
Fri Feb 9 07:55:30 PST 2024


Hi,

My obligatory “long time listener, first time caller”:  I joined the list about a year ago and have enjoyed reading the daily happenings even though I haven’t really contributed directly yet. I was offline recently and finally got a chance to catch up. Wow! There were more messages in the last couple weeks than I’ve seen on this list since I joined (combined, or at least it felt like that).

Anyway, I wanted badly to be upset with Juan’s change to OrderedCollection class>>new:. Generally speaking, I do think that peer/sibling classes should be allowed to implement the same method with very different behavior. Of course if the parent class also implements the method then it does seem reasonable that there are restrictions, and I do think that defining those rules is also reasonable. No I’m not going to suggest what those rules are 😊

The bigger issue seems to be with the concept of changing well established historical behavior. I assume we are all familiar with Python’s switch from v2 to v3. We know now that Python survived the version change and is very much thriving, but back when the change happened it wasn’t so sure that it would. Breaking changes are bad, especially when there is a lot of code out there that potentially will no longer work.

I think that was Gerald’s point about marking it as deprecated for a time and having the method log the soon to be invalid usage. It may be worth going a bit further than that and having a standard way to tag source code to say what version it was written in, or what versions it is compatible with. Then, if breaking changes are documented by version then you have a proactive way to look for code patterns that need to change. It may even be possible to make a tool to help with this. In this particular case, “OrderedCollection new:” should be easy enough to find.

Just my 2 cents as a bit of an outsider’s opinion.

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240209/cdfb9a44/attachment-0001.htm>


More information about the Cuis-dev mailing list