On 3/08/2014 7:36 p.m., Bayan Rafeh wrote:
A small background on this:

I'm a university student about to start my graduation project with two
teammates, both of which have a C/Java/Python background and I suggested
we use D for our project. They're not familiar with it, so I wrote a
short tutorial for them here: https://github.com/bayanr/d-tutorial.

I wanted to see what you guys thought, and if this could be a useful
introduction for people with similar backgrounds. It's a first draft so
it probably has a lot of mistakes, omissions, etc. so any criticism is
welcome.

Your introduction to templates is far too simplistic.
What you introduced was template blocks. But showing them as templated classes.
There is also templated functions, methods ext. After all.
It may also be wise to introduce CTFE as well. But not so important.

I.e.

class ArrayList(T) {
    T[] l;
}

alias IntList = ArrayList!int;
IntList list = new IntList();

would probably be better.
That way also the compiler doesn't have initiate the entire template just to get one class definition out of it.

Everything else looks good including mixin templates. But just for food for thought. With statements are cool.

Hope to hear more of how the project goes.

Reply via email to