I understand that this might be because the underlying language is of course 0-based as well. And of course I would have been happy as well if the old containers would have been 0-based. But the problem is that with this choice now we have a set of containers that are 1-based (all the dyn_) and one that is 0-based. This will undoubtedly make the use of the subscript operator more prone to errors and the review of code more cumbersome (now you need to know the exact kind of container just to know if it is 1 or 0 based, which might even get more cumbersome if you're using the new using feature for type alias). Since this was introduced in the last patch, there is for sure still a tiny code database making use of vectors, so it would still be feasible to change this to be 1-based for coherency.
Example:
Code: Select all
vector<int> list;
list.append(1);
list.append(2);
DebugN(list[1]);
dyn_int list2;
list2.append(1);
list2.append(2);
DebugN(list2[1]);
Code: Select all
WCCOActrl2:[2]
WCCOActrl2:[1]
I guess these things have been already considered and I might be missing sth, but just in case I wanted to give my 2 cents and would be interested in hearing the opinion of developers or other users on this subject.
Kind regards,
Daniel