Re: A little disappointed

From: Anthony Borla (ajborla_at_bigpond.com)
Date: 11/28/04


Date: Sun, 28 Nov 2004 22:27:39 GMT


"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 aren't too mysterious or difficult. If you practise
> > and experiment with them, you'll get more comfortable
> > with them.
>
> 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].

Also, one important reason pointers have been problematic in C and C++ is
because pointer misuse often 'brings down the whole house' [i.e. program
crashes, core is dumped etc]. It's probably human nature to want to avoid
[rather than understand and try to circumvent] practices which lead to such
catastrophic events.

>
> I would suggest that newcomers to C++ should avoid them as
> far as possible;
>

I think the term 'newcomer' needs clarification. A newcomer may be someone:

* Entirely new to programming

* With some background in programming, probably with a
    scripting language, but otherwise no formal data processing
    knowledge / training

* A computer science / information technology student with
   knowledge of algorthms and data structures, and some
   experience of programming, say in Scheme or Java

* An experienced programmer undertaking a new project, who
   has not been involved in the implementation language decision
   process, and has to learn the language under pressure, and
   by attending 5 Day ['all the C++ you can eat'] Courses

Each would need to approach the learning of C++ in very significantly
different ways in accordance with their current knowledge / skill level, and
specified learning goals.

>
> unfortunately, this advice can not be given to
> newcomers to C, where it is hardly possible to do anything
> useful without them.
>

Including obtain user input with 'scanf' which represents one of the most
[if not *the* most] common examples of 'pointer misuse' in C ;) ?

Cheers,

Anthony Borla



Relevant Pages

  • Re: The smartest band in the world?
    ... first class honours if they come close in their final year, ... programming career would need a rudimentary unserdtanding of C, ... there was another language called Eiffel - but it too died in the ... introduction to OO though - no pointers and headers files like C++, ...
    (alt.guitar)
  • Re: C++ vs C#
    ... >oriented programming language with wide support, ... >Template Library) and many other libraries and lots of books written for it. ... >pointers, references, and pointers to pointers, and pointers to references ... It has simplified programming for Windows and seems to be the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Why is OO Popular?
    ... > young children interact and think about the world and they based the GUI ... traversing networks of pointers, when the computer should be able to find ... and in fact failed to fully explore functional and logical programming (and ... you have any language you ...
    (comp.object)
  • Re: C++ vs C#
    ... Template Library) and many other libraries and lots of books written for it. ... It is a very complicated language however and you'd better get real used to ... pointers, references, and pointers to pointers, and pointers to references ... It has simplified programming for Windows and seems to be the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: which language i should learn, ( to learn algorithms and software design ) ?
    ... indeed language independant. ... you'll have to put the theory to practise. ... good programming is more difficult and time consuming than picking up ... he threw away the 35 CDs of WIndows and Windows based software and he ...
    (comp.programming)