C++ & STL: last, best hope for software reuse? Or just a cruel ho

Joe Barrera (joebar@MICROSOFT.com)
Tue, 11 Aug 1998 16:28:10 -0700

So I'm finally learning how to use C++'s STL and so far it looks truly neat.
Finally, a language that provides the low-level OS and bit-tweaking
capabilities of C, while also letting me handle strings and lists and arrays
(vectors) and hashes (maps) without all the memory micro-management that C
forces you into. I mean, I've always hated the fact that in '78 on a 1MHz
8080 I could write

A$ = B$ + C$

to concatenate two strings, yet in '98 on a P-II I find myself having to

A = (TCHAR *) malloc((strlen(B) + strlen(C) + 1) * sizeof(TCHAR));
strcpy(A, B);
strcat(A, C);
free(A); /* in all cases, even error cases - and if you forget, you
have a memory leak */

I mean, this is progress?? Finally now with STL I can once again write

A = B + C; // although "string A(B + C);" is probably more "C++ -

At any rate, what will I find when my honeymoon with STL is over? Has anyone
on this list already had their heart broken by STL?

- Joe

Joseph S. Barrera III
Work: (415) 778-8227, Home: (650) 588-4801