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 = new char[ 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.
<a href = http://www.codeproject.com/script/profile/whos_who.asp?id=14112#Blog> My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
Last Visit: 31-Dec-99 18:00 Last Update: 26-Apr-17 8:01