Re: Why Pascal?
- From: Keith Hopper <asgard@xxxxxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 12:10:42 +1300
Mmmmm! I've been lurking on this thread for a wee while reading
various points of view pro/anti this that or the other language.
First of all may I propose that all programming is an attempt to model
(some part of) something in the real world - the traffic light example, for
instance.
If you read back through the thread you will see that the word
'coding' has appeared several times. This is what the programming model
does - encodes things.
May I refer you back before Niklaus Wirth to George Boole - who wrote
in Proposition 1 of Chapter 4 of his book -
All logical propositions may be considered as belonging to one or
other of two great classes, to which the respective names of 'Primary' or
'Concrete Propositions' and 'Secondary' or 'Abstract Propositions' may be
given.
Primary things are those whch we cannot alter in our model - the
actual colours of traffic lights for example are determined by the
lcd/glass manufacturer (and perhaps the current weather) - we can only give
them names (denotations if we want to talk about formal modelling!) for use
in our model.
Secondary things are those which our model can manipulate - evincing
whatever behaviour we wish in terms of primary behaviours defined for more
primitive types.
In Pascal (as others have said) we can call traffic light colours by
name - but it makes absolutely no sense at all to 'give them a value
(numeric or not)'. They are just names of colours.
In low level languages like C or C++ one has to actually specify a
particular encoding - and then be manically careful not to do the wrong
kind of thing by adding red and green and pretending to produce 'yellow'.
Good programmers should always use a type-safe language - one in which
you cannot add red and green - because there is no such operation
available.
I rest my case!
Keith
--
Inspired!
.
- Next by Date: Re: Why Pascal?
- Next by thread: Re: Why Pascal?
- Index(es):
Relevant Pages
|
Loading