On Monday, 31 August 2015 at 21:09:02 UTC, Minas Mina wrote:
Constructive criticism is welcome.
In the "define a dynamic array" section, I often find myself
numbers.length = 3;
int numbers = new int;
I understand that this fits with the resizing section later a bit
better, but it's just how I typically do it.
You might show some examples of functions where you can pass
dynamic arrays, but not static arrays.
In general, I find myself very easily getting mixed up by the
syntax of the static vs. dynamic arrays. For instance, compare
int x = new int;
int y = new int;
auto z = new int;
x and y are obviously dynamic and static arrays, respectively.
However, my initial guess on z is that is like y, a static array
on the heap. But that is wrong. It's actually like x. Easy to get