|
From: Ioannis V. <no...@ho...> - 2002-04-08 02:13:44
|
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Bob
Wilson
Sent: Monday, April 08, 2002 2:43 AM
To: Dev-C++ User Mailing List
Subject: [Dev-C++] Why don't they?
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.
Don't try to learn the language and an IDE at the same time. C++ is not
Basic and you must know what belongs to the official language and what
is a system extension. I will not lie to you, to learn using the
language and learn some IDE it will take at least 1 year. To learn using
the language efficiently 2+.
If you are in a hurry then learn some language with less abilities e.g.
Pascal/Delphi or Java etc.. But you can't write an OS in Delphi, Java,
VB etc. :) Nor a compiler for your own programming language.
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.
Lets explain a bit to you what is the ANSI C++ 1998 standard. Do not
think programming is only for a PC. C++ is used from small embedded
microcontrollers (e.g. a telephone system) to large mainframes. The
ANSI/ISO C++ standard guarantees what can be considered portable (that
is ANSI/ISO C++ code can run everywhere). As a result, of all these C++
is designed for maximum efficiency under *serious* space/time
constraints. That's way that everything important is written in C++
(Java virtual machines, Visual Studio, Windows, Office, etc). ANSI C++
provides input/output facilities but as i see you wish to learn
everything at the same time. It can't be done. Read your book first to
understand the basics (abd learn some input/output) ad you will find
anything in course.
To understand why C++ will take some time to learn, it is because C++ is
a multiparadigm language and every paradigm is supported well and with
the maximum efficiency (for example it supports multiple inheritance
that Java etc do not support in the object oriented paradigm). Another
paradigm is the generic paradigm, that is algorithms and containers that
work for any type. The generic paradigm is implemented with C++'s
templates which was invented by Alexander Stepanov a Russian
mathematician, after discussions with Bjarne Stroustrup the creator of
C++ who is a genius.
A simple example of templates:
template <class T>
T add(T a, T b)
{
return a+b;
}
The above function works for any type of variables and returns value of
the same type. This can't be found in another language.
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.
C++ supports 4 paradigms: Object Oriented, procedural, modular and
generic programming. And these in the best way (more things than the
other languages).
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.
No this is a mistake. Visual C++ 4 is too old. Even Visual C++ 6 was
considered as borken compiler (was made the same time of Window 95!).
With the new Visual C++ 7 things got better. Do not buy any older
version than 7. Also Borland C++ Builder is better (it has a RAD like VB
with much more components).
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.
If you are referring to Dev-C++ programming environent, it is not so
difficult. If you are referring to some commercial IDE then i suggest
learn enough C++ before. Also keep in mind that it will take 1-2 years
at least. The language is the difficult part, the rest is done with some
IDE which provides some system extensions. That is some C++ library with
ready components that do the job. For example Borland's VCL provides a
TProgressBar to design a moving progress bar. Of course all these are
useless if you do not know how to use the ProgressBar object (that is
you know C++). To learn a professional IDE/library perfectly if you know
the language will not take more than 2-3 weeks. So concentrate on the
difficult part (the language) first.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
<http://www.noicys.cjb.net/>
* Alternative URL: http://run.to/noicys
|