Re: A little disappointed
From: Alwyn (alwyn_at_blueyonder.co.uk)
Date: 11/29/04
- Previous message: Alwyn: "Re: Screen Colour combinations"
- In reply to: Anthony Borla: "Re: A little disappointed"
- Next in thread: Francis Glassborow: "Re: A little disappointed"
- Reply: Francis Glassborow: "Re: A little disappointed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Nov 2004 13:41:22 GMT
On Sun, 28 Nov 2004 22:27:39 +0000, Anthony Borla wrote:
> "Alwyn" <alwyn@blueyonder.co.uk> wrote in message
> news:pan.2004.11.28.12.49.33.431401@blueyonder.co.uk...
>> On Sun, 28 Nov 2004 07:33:24 +1100, David White wrote:
>>
>> Pointers have been called 'the gotos of data' in that they
>> introduce pitfalls for the unwary and are a source of
>> programming errors.
>>
>
> True.
>
> However, I'd suggest one way of improving matters is to make the unwary more
> wary via eduaction / training rather than teaching avoidance [or as some
> languages have done, disallow programmer access to the facility, thus
> forcing avoidance].
Well, the modern way of teaching C++ seems to be to introduce it as a
higher-level language, without touching on pointers at all, or leaving
them till a later stage of the learning process. This is the approach
taken by Koenig and Moo in *Accelerated C++*, and also, I believe, by
Glassborow in his beginners' book. Of course, we all know that C++ has
pointers, which are treated almost identically to those of C, and so
cannot be a real high-level language, but with its references and standard
library, it makes a passable attempt at imitating one.
Ideally, even an experienced C++ programmer is recommended never to handle
raw pointers but rather use them wrapped up in so-called smart pointers.
Since the only thing approaching a 'smart pointer' in the current
standard is the fragile 'auto_ptr', one must either use a third-party
library or invent one's own.
Alwyn
- Previous message: Alwyn: "Re: Screen Colour combinations"
- In reply to: Anthony Borla: "Re: A little disappointed"
- Next in thread: Francis Glassborow: "Re: A little disappointed"
- Reply: Francis Glassborow: "Re: A little disappointed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|