All the examples where they're useful are contrived.
And simplicity is an actual goal of computer language design.
And simplicity is an actual goal of computer language design.
array[i++] = this;
array[i++] = that;
array[i++] = the_other;
which also extends nicely when some of those elements are optional. array[postincr(&i)] = ...;
if you're doing enough of those that it's worth it.Most modern languages have an append-to-list method/function, so your example isn't really applicable in those langauges. For example, ArrayList#add() for Java or Vec::push[1] for Rust, etc. (Yes, these are technically dynamically sized arrays, but you can always reserve the necessary amount of space up front if you so desire.)
[1] https://doc.rust-lang.org/std/vec/struct.Vec.html#method.pus...