Re: Agile C++?
Posted: Jan 13, 2005 11:57 PM
>Luis Sergio Oliveira
> > PS: std::string was available about 10 years ago, but,
> > even today you see people coding with char * in new
> > projects. They say that std::string isn't performant
Unless they have measured, and found this, I'd think this is just superstition. There's no reason that std::string can't be just as efficient as hand-coding your own string code (but without the tedium of doing that - I've done it when I used C, and I don't miss it. :) ).
> If memory serves me right, the Standard Library became
> standard in 1998.
> I only started buying C++ books again in the last
> couple of years.
Mine has been a similar experience. I started learning C++ around 1996 or so (and had learned C before that). Later, I went back to school, and had Java there for a few years. When I was done, and started reading up on C++, again, I found two things:
1) It wasn't your granddaddy's C++ anymore: :) a lot had changed.
2) I kind of had to "deprogram" myself, after having learned Java. Since everything is a class in Java, then for a while, I continued like that in C++. So if I needed some utility functions, I made a class with static member functions. Having read up on C++, again (Stroustrup, Meyers, Sutter, etc.), I realised that this wasn't necessary: I could just make them free functions in a namespace...
However, to its creadit, it was first when I had Java at school that I really "got" OO. I had read Stroustrup (2. edition) earlier, and tried to use it to learn C++, and found that difficult (especially if you don't know OO, like I didn't. The book started with a "Tour of C++", and I fell off already there, because it mentioned things like support for OO and generic programming, and I didn't know what either of them meant. :) ). It's a good reference, but I wouldn't recommend it for learning C++ (however, I understand the 3. edition is better in this respect, too). Had I started today, I'd preferred "Accelerated C++", which starts with C++ as a high-level language, i.e. using the standard library, etc. Stroustrup is kind of a book that may be useful as a next or n'th book, having got the basics of both C++ and OO.
> After reading Essential C++ by Lippman, I replaced most of
> my C library code in the project I was working on with
Sounds good. :)
> Once in a while I pull my Stroustrup,
> Vandevoorde/Josuttis, & Alexandrescu books off the shelf,
Good books. :)
> Looks like my C++ books will stay on the shelf a while
> longer, since I have "Refactoring To Patterns", & "Working
> Effectively With Legacy Code" sitting here waiting to be
*g* Both highly recommended. I read both recently, and is currently re-reading Fowler's "Refactoring". That's also a gem.
I'll probably revisit GOFs "Design Patterns" again, too, and I think I'll make a list for myself of the refactorings and patterns in these books (as well as the techniques in "Working Effectively with Legacy Code"), because I discovered that I didn't know them well enough. It's my experience that in order for refactoring and design patterns to be useful, you have to at least know about them and their intent, so that if you're in a situation were one may be useful, you may recognise it, rather than "reinventing the wheel".