RE: [Dev-C++] Deliberate crashes - more information
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2002-04-09 16:24:47
|
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Bob
Wilson
Sent: Tuesday, April 09, 2002 4:05 PM
To: Dev-C++ User Mailing List
Subject: Re: [Dev-C++] Deliberate crashes - more information
Ioannis,
There are techniques which C++ inherently supports such as "resource
aquisition is initialization" that you can not apply if you do not know
how to define classes and work with objects. C++ is a very serious
thing, be patient and you will learn everything (i am still learning it
myself since summer 2000!). "Teach Yourself C++ in 24 Hours" (even 21
Days) could not cover the whole C++, imagine now the techniques that it
was designed to support. The book is excellent to make you reach close
to the intermediate level of C++ programming.
I am not impatient, but it makes absolutely no sense to not teach four
things when you teach a computer language. In order of importance they
are:
1.
The syntax or grammar of the language. It is impossible to do
any serious programming if you do not know the language. (I think this
is what you are saying, and I agree strongly with it.)
2.
Good language specific programming practices like initializing
all pointers as soon as they are created, deleting them as soon as you
are finished with them, and setting them to null or zero as soon as you
have deleted them. This is damn near as important as learning the
syntax.
Initializing all pointers and variables to some initial
value is something like a religious matter and has caused strong debates
among professional programmers in various discussion groups i
participate.
There is the opinion that initializing them to some value can help
discover bugs easier since the start value doesn't produce random
behavior which helps debugging and the opinion that if you initialise
with a certain value may hide some bug which will be discovered too
late, which would have been discovered in the testing process if it had
no start value.
My approach on this matter is that one of the benefits of C++ is that it
allows to you define variables in the first place you need them, so
don't define everything at the beginning (which by itself increases the
possibility of a bug) but define everything in the first place you need
it.
1.
1.
2.
3.
Elucidation of how to solve or avoid common language related
programming problems.
4.
How to make your language specific code bullet proof.
I think the bullet-proof code is a thing that must be taught after the
basics.
Ioannis
* Ioannis Vranos
* Programming pages: <http://www.noicys.cjb.net/>
http://www.noicys.cjb.net
* Alternative URL: <http://run.to/noicys> http://run.to/noicys
|