On Monday 31 March 2003 01:03 pm, Jerry Feldman wrote:
On Mon, 31 Mar 2003 10:48:43 -0500
"Steven T. Hatton"
wrote: Let me refine this. Upon reflection, I realized what I said is only accurate regarding fundamental types. Objects are the other way around. I have to tell them to go away explicitly, or they just sit there and take space. And if I don't to that before I remove the last pointer to the object, then I have not way to access the destructor.
When a variable goes out of scope, a destructor is called. I suggest that when you are learning C++, start by writing your own classes. Then, once you understand the language, then start using the STL and other class libraries. The STL has a large number of container types, such as vector, link lists, trees et. al. But, while these are great to use, the details of the implementation are hidden. That's not a bad thing, but when you are learning a language you are not learning some of the finer points of that language. For instance, a person who does not know Java can pick up JBuilder and build some programs, but not lean how to write Java code.
This is true to some extent, but I've found the GUI builders, and other wizards are often more trouble than they're worth. I tend to use them to generate samples that I look at to figure out how to accomplish what I really want. The one place were JBuilder did prove really helpful was in getting me started with servlets. The Apache Tomcat is configured and ready to run out of the box. I was able to click on new servlet, build, run, and I had a working servlet. But that doesn't do much on its own. The biggest advantage in using something like JBuilder is that it helps organize the project, and provides quick access to resources such as class browsers, code completion, on-line documentation, etc. But the Java world in general is oriented that way.
In C++, you should first lean the basics of the language, then move up to writing some classes.
Part of the problem is I'm re-learning. There was a time I knew C fairly well. Not to say I was a good C programmer, I just had a pretty complete understanding of the basics of the language. I do need to continue reading up on C++. Unfortunately, I don't know of anything for C++ equivalent to K&R, Cooper's Pascal book, Arnold, Gosling, and Holmes's Java book, or Flanagan's JavaScript book. Then again, I haven't been looking. I'm kind of limited in what I can buy right now. I also haven't been able to focus on the language as much as I would like due to the problems I've been having with my KDevelop setup. Hopefully I have that stabilized, and won't need to mess with it for a while. I'll have to go back and forth between using KDevelop and XEmacs while learning C++. KDevelop and the QT Designer do provide a useful framework. But as you've pointed out, they don't teach the language. That's why I cracked open XEmacs and tried to write a hello world. When I got the deprication messages I tried to find out how I should be writing a hello world. The books I have were no help. I was using the example code from these books. That's when I came on this list. There has to be a better way of getting started than this. Are there any good books that teach C++ using these new standard libraries? I.e., a book that starts with the kind of hello world I ended up with after a few iterations?
Then learn multiple inheritance and templates. The problem is the time tradeoff. Most of us want to be productive and get something out the door, or use the skills on the job.
That can be quite frustrating. It's not like the good old days when someone could ask you how long it will take you to plough the field. You could go ask your grand dad how long it should take. Now people want to know how long it will take you to do something that no one knows how to do, or at least you don't know how to do it. If you knew, it would be done! And then there's doing things correctly. That's where really knowing the language, and all the nuances comes in.
-- -- Gerald Feldman
Boston Computer Solutions and Consulting ICQ#156300 PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9