|
From: Bob W. <bo...@ph...> - 2002-04-08 00:41:46
|
MessageIoannis,
Thanks for the response.=20
You did the right thing. C++ is great.
I am not sure it is "great," but its use is certainly wide spread. IMHO, =
there are better languages and better programming environments, but, as =
you mention, C++ is the most widely used language, and if you want to =
work in the highly competitive IT community, it is necessary to know =
C++.=20
You probably write console programs.=20
Yes, at my current level of knowledge, about the only thing I can do is =
write console programs. Hopefully by the middle of this week that will =
change.=20
To run the console program either open a console in the directory your =
.cpp is placed and run the .exe from there or do:
#include <cstdlib>
and inside main() at the end:
std::system("pause");
I started out using system("PAUSE"), but since I wanted to learn how to =
design a function which would determine if any key had been hit, what =
that key was, and reset itself for later use, I started playing around =
with the conio_mingw function kbhit(). Unfortunately that function does =
not do what I want, and I haven't either figured out how to write the =
code to do what I want yet. There may well be a pre-exiting function in =
one of the copious C++ libraries which does what I want. In any case, I =
know I will eventually figure it out.=20
I prefer the console option myself.
You recommended that to someone else. I had not thought of that, so I =
tried it. Thanks for the recommendation, but it seems take more time to =
switch between windows than to just cut and paste the required code into =
your source code and select the option to compile. Also, the limitation =
of the length of file names in the Console window is counter to good =
self documentation of function of the source files and the resulting =
programs.=20
The goal of the book is i guess to teach you the standardised ANSI/ISO =
C++ 1998 language
which is a very good thing.=20
I agree that it is best to learn the standard language, but anything =
that detracts from the goal is counter productive. I am fairly certain =
that I am not the only person who has spent an excessive amount of time =
trying to solve a problem with the IDE or programming environment =
because of either the lack of documentation or the lack of a good =
tutorial. The key to writing tight, efficient code that does something =
worth doing is a depth of knowledge of the language, the target =
operating system, data structures, and the correct algorithm to solve =
the problem or accomplish the task.=20
The key to becoming productive in any given programming environment is =
practice. This is the monkey-see, monkey-do part of becoming proficient =
with a new language/environment. If employment of the programming =
environment is obscure or there are undocumented gotcha's in the IDE, it =
simply increases the time required to learn the language to any given =
level of proficiency.=20
Also you start and end C-style comments at every line. This is waste =
of calories. C-style comments have scope till the */ is found and // =
comments one line only. For example:
/* This is a C-style comment.=20
It can consist of many lines and you do not need to open and close =
every one at
every line
*/
// This comment has scope till the end of
// the line only.
I am aware of that. I frame my comments only to make them standout =
visually. I spent too many hours either looking for almost hidden =
comments while trying to modify or fix bugs in old program that I or =
someone else had written. Repairing "broken" software taught me, like =
many others, how important it is to write code that is as self =
documenting as possible and to also sprinkle detailed comments =
throughout the code so that the next programmer that has to work on the =
software doesn't cuss the author as he tries to track the program logic. =
The extra key strokes are really a non-issue. My default source has a =
box at the top. All that is required is to do a simple cut and paste if =
I want to expand the comment. I do not have to recreate anything. All I =
do to write the comment is to set the keyboard to typeover rather than =
insert. The only real negative is that my style of comment bloats the =
size of the source. Considering that compilers discard comments and disk =
space is relatively cheap, that too is really a non-issue.
No, the aims are what they should be.
I agree that the aims are what they should be, i.e., to teach ANSI C++, =
but when the supplied programming environment detracts from or =
complicates the learning process, and those complications and =
distractions could be eliminated by a little bit of attention to the =
supplied programming environment, the book does not meet its goal in =
either an efficient or an elegant manner.=20
I am not sure if that book is enough easy for a newcomer though. If =
you feel someday that you can't go on with this i suggest "Accelerated =
C++" By Andrew Koenig - Barbara Moo.=20
No, I'll get through it and will learn the programming environment at =
the same time, but I could probably learn it 20% to 30% faster with more =
information about the supplied Bloodshed 4.01 programming environment.=20
I must mention however that i began C++ with "Teach Yourself C++ in 21 =
Days" myself too.=20
I went the less expensive route, Teach Yourself C++ in 24 Hours. It is =
not as complete, but it does have a good overview of the language.=20
Also keep in mind that with programming you must think a lot. :)=20
You can say that again. I don't mind the thinking, I enjoy it. I just =
don't like the unnecessary obfuscation provided by a lack of =
documentation.=20
You must like it very much etc, etc. Also keep in mind that C++ is the =
dominant general purpose programming language according to IDC for 2001 =
with 2.6-2.8 million developers worldwide. VB was second with about 1.5 =
and the rest follow. C++ as the best language has very advanced concepts =
but with this you can do everything (the entire Windows, Visual Studio, =
VB, Office, etc are written in C++). And all these to give you courage =
to keeep going on. :)
As I said, I am convinced that C++ is necessary to any success in the IT =
field. Perhaps even more important, I am enjoying process of learning =
the language. It is very versatile and very powerful. In its current =
iteration, it is perhaps the best language for OOP (Object Oriented =
Programming). Delphi or any of the late Borland Pascal compilers are =
also excellent for OOP, but it looks as if C++ will be both more =
versatile and more intuitive.=20
If you are taught ANSI/ISO C++ there should be no differences.
I agree that there should be no differences, and, while I have no =
personal experience with Microsoft's Visual C++, I have read that Visual =
C++ 4.0 matches the ANSI/ISO standard more closely that any of the =
follow-on products because of Mirosoft added extentions.=20
Both are valid. The second is used only when you want to pass command =
line parameters.=20
That should not be needed for learning C++.
That may be, but one worked and the other did not.=20
Better begin with no project. Only a new file and save it as .cpp. =
First learn the language. Then you will learn an IDE. So there is no =
surrender, only the proper order.
Now that I have learned how to use the project creation ability of the =
Bloodshed/GNU environment, it is not a problem.=20
I am sure you have gathered by my comments above that I disagree with =
your suggested order. You need to do both at the same time. Obviously =
most of the effort should be expended on learning the language, but =
efficient learning of the C++ is enhanced with some basic instruction on =
the programming environment. By saying that, I am not advocating that =
one's level of knowledge of the programming environment should be even =
close to one's knowledge and familiarity with the C++ language when you =
finish the book.=20
Regards,
Bob
|