Multisort

bearophile bearophileHUGS at mailas.com
Sun Jul 6 14:47:34 PDT 2008


I haven't tried your code (yet), but I suggest you to not use too much long lines (90-100 chars is probably enough).

Your code contains both the forms:
    foreach(ti, array; data) temp[ti][index] = array[$-1];
    ...
    foreach(i, array; temp) {
        data[i][0..$] = array[0..$];
    }

I suggest you to use the second form, or the following one if you want to save a line:
    foreach (i, array; temp)
        data[i][0..$] = array[0..$];

I suggest you to avoid writing a single large unittest, but to add one block of unittests under each function/class/method, so you can isolate them better, disable them, etc (even better is having a standard way to give them a name, so the program/compiler that executes the unit tests knows what function/class/method are broken. D unittest system needs just small improvements to become good enough for small/medium size programs).

Bye,
bearophile



More information about the Digitalmars-d mailing list