Previously there was ArrayList.count() (removed in c3d8b1f) and then ArrayList.len (removed in dd570db). ArrayList.items.len is now the way to determine the number of items . I'd prefer a count() method; it could simply return items.len just like the previously removed count().
I think that would violate the "only one obvious way to do things" point of the zig zen. I personally don't see what's wrong with using items.len, having a dedicated method to access this value seems like a pointless abstraction.
I'm perfectly fine with that but this must eventually be properly documented. Knowing that ArrayList has an internal slice called items is not obvious unless you read the source.
Edit: To further clarify, it could be viewed as a leaking implementation detail and requires a stable implementation.
items is part of the API. It is not an internal implementation detail.
Most helpful comment
I think that would violate the "only one obvious way to do things" point of the zig zen. I personally don't see what's wrong with using
items.len, having a dedicated method to access this value seems like a pointless abstraction.