2 days ago

Not sure where to post this, but the forum CAPTCHA process could stand to be improved. The forum thought my latest post was spam so presented me with the following CAPTCHA challenge asking what does this function return:

string n()
{
    return format("d=%02X", 24);
}

And provided a helpful hint that you can run code online at https://run.dlang.io/ if you don't have a local D compiler.

Of course, this won't compile as-is, as it is missing import std.format; and then after that you'll get a linker error stating there's no main function.

The CAPTCHA should read:

import std.format;
import std.stdio;

string n()
{
    return format("d=%02X", 24);
}

void main()
{
    writeln(n);
}

Or something to that effect; maybe inline n() into main() and ask what the program outputs rather than asking what the function returns.

Could many of us look at the original function and know off the top of our heads that n() returns the string "d=18"? Probably yes. But consider the newcomer to D (or programming in general) who is going to paste the CAPTCHA code into run.dlang.io, get an error message, and have a bad experience with D before they even really started.

I think having a little D code in the CAPTCHA is great and different, but it should be something that you can paste into run.dlang.io and get an output that you can paste right back into the box.

Just my 2 cents.

~Brian