Quote Originally Posted by whiteflags View Post
You even espouse the approach passing arrays as references before we ever hear that maybe C arrays aren't the right type. The problem is that this approach causes massive overloading based on type.
You're right. That should probably be mentioned.

The array type, and its behavior in a majority of contexts, means that you should be writing functions that accept arrays of various sizes. It doesn't help to ruin a perfectly good function with nonsense like assert(size == 10); That's not going to work the second that the array is intentionally different. And a majority of the examples are contrived because of this reason; the article itself doesn't acknowledge how arrays are actually used in programs.

This article could be shortened considerably it admitted that C arrays were the wrong type in some places.
So we do agree that the examples should be rewritten to accept variably sized arrays. And yet, a lot of functions do take arrays of known size. I think that, at the very least, this should be mentioned because I see a lot of programs that do it that way and the fact that the compiler completely ignores the size in the declaration is very dangerous...

The article also focuses on approaching as many different approaches to passing arrays as possible and discussing advantages and disadvantages because you are likely to see all these somewhere (the ones missing are probably legacy interfaces and iterator interfaces). That said, while the article isn't perfect, at least I think it does some things to raise awareness, which is better than nothing. Also, as lazy as I am, changes are probably slow, so if you aren't lazy, then feel free to change the article a little bit to fit your vision better. It is, after all, the advantage of an open wiki.