comp.lang.ada
 help / color / mirror / Atom feed
From: Anders Wirzenius <anders@no.email.thanks.invalid>
Subject: Re: Avoiding side effects and other dogma.
Date: Tue, 14 Oct 2008 06:22:49 GMT
Date: 2008-10-14T06:22:49+00:00	[thread overview]
Message-ID: <u8wsrwv9j.fsf_-_@no.email.thanks.invalid> (raw)
In-Reply-To: C51956DF.FC7C2%yaldnif.w@blueyonder.co.uk

"(see below)" <yaldnif.w@blueyonder.co.uk> writes:

> On 13/10/2008 13:27, in article uabd8adeb.fsf@no.email.thanks.invalid,
> "Anders Wirzenius" <anders@no.email.thanks.invalid> wrote:
> > 
> > Is the dogm you refer to something like "functions without side
> > effects". 
> 
> That's just one of many, along with: "never use goto", "never use
> exceptions", "never use 'use' clauses", "never use pointers", "the OO
> approach is always right", "the market is always right", etc, etc, etc.
> 
> > 
> > I am not a professional programmer any more and I just
> > wanted to learn something about side effects. What is silly in that?
> 
> What is silly is tying yourself in knots to avoid a perfectly sensible way
> of doing something, because it is abominated by the adherents of a dogma.
> 
> The trouble is that bright people (Dijkstra, Hoare, Dahl, etc) offer
> recommendations for general approaches, to be applied with common sense; but
> then their much dimmer followers turn the recommendations into religions.
> 
> I encountered this a lot as a teacher. I remember giving a lecture on memory
> management techniques and being confronted at the end by one a student who
> demanded that I should say which was "the best". When I explained it was not
> possible to do that, he insisted that I really knew which was the best and
> was keeping the secret to myself.
> 
> Too many software practitioners (among many others) have that mindset.

As a teacher you may then be familiar with the difference between
"wanting to learn" and "programming for production". To me it is a
good technique to "strive for perfection" if you use that as a
tool for learning something about a subject.
You may write a program using a goto whenever you have a need for
jumping somewhere and after that write another version of the
program without a single goto. And then write a third version
adopting yet another dogma. The three versions are useless once
you have made up your mind about the consequences of adopting
different principles. You throw those versions in the recycle bin
and start to write the "common sense" adopted program
version. And keep that.

-- 
Anders



  parent reply	other threads:[~2008-10-14  6:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30  5:50 Avoiding side effects Anders Wirzenius
2008-09-30  7:48 ` Jean-Pierre Rosen
2008-09-30  9:20   ` Anders Wirzenius
2008-09-30 11:36     ` Jean-Pierre Rosen
2008-09-30 12:43       ` Anders Wirzenius
2008-09-30 10:42 ` Ludovic Brenta
2008-09-30 11:12   ` Anders Wirzenius
2008-10-02 12:56 ` Ole-Hjalmar Kristensen
2008-10-06 12:09   ` Anders Wirzenius
2008-10-07 11:08     ` Ole-Hjalmar Kristensen
2008-10-07 14:24       ` (see below)
2008-10-07 14:47         ` Anders Wirzenius
2008-10-07 14:51           ` (see below)
2008-10-08  5:16             ` Anders Wirzenius
2008-10-08  7:35               ` Dmitry A. Kazakov
2008-10-08 15:32               ` (see below)
2008-10-13 12:27                 ` Anders Wirzenius
2008-10-13 13:21                   ` Marco
2008-10-13 18:55                     ` (see below)
2008-10-14  7:30                       ` Dmitry A. Kazakov
2008-10-14 11:44                         ` Colin Paul Gloster
2008-10-13 18:49                   ` (see below)
2008-10-13 21:22                     ` Adam Beneschan
2008-10-13 21:53                       ` (see below)
2008-10-14  6:17                         ` mockturtle
2008-10-14 14:58                           ` Adam Beneschan
2008-10-14  6:22                     ` Anders Wirzenius [this message]
2008-10-14 13:48                       ` Avoiding side effects and other dogma (see below)
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox