At one point (end of 2003), the web was full of blogs from some very interesting people, like Herb Sutter, Brandon Bray, etc. However, it seems that most of them gave up blogging soon. Stan Lippman is "the last man standing" in this regard, and I try to keep an eye on his blog.
One thing I found on his blog was the next piece of code (from this article[^]:
char *ch = newchar[ len ];
bool result = wcstombs( ch, wch, len ) != -1;
target = ch;
See the last line? It should really be:
In fact, why did Stan even use this new...delete construct here? Modern C++ offers this alternative:
bool result = wcstombs( &ch, wch, len ) != -1;
target = &ch;
Stan's explanation: it is a bad habit for an old dog who was programming with the language before this was added, and of course in current implementations, its absence is actually both non-fatal and possibly more efficient.
This makes me wonder. If a master like Stan Lippman makes a mistake like this, something is wrong here. Old dog's habits are hard to get rid of. Maybe we really need a new, smaller and cleaner language, after all - a language that would inherit the power of C++ but leave the C heritage behind. The problem is - I don't know such a language - Java and C# are definitely not what I have in mind.