counter++ versus "add 1 to counter"

A.C.T. albrecht at act-net.com
Sun Mar 21 12:06:15 EST 2004


Hi, Scott,

> This is an interesting point of view Marc, but I wonder if you are basing
> your point of view on your knowledge of C.  Look at your example:

Yes, absolutely. I did not make that clear enough, sorry.
The basic for my "excurse" was, of course, that the "reader" (and the 
writer) of code is a developer, not a narrator. A developer will most 
likely be used to the standard term "++". That's the basic for me saying 
"it is clear".

> And, if I understand what are saying, Transcript does
> in fact return an error if you use incorrect variable types:
> 
>   put "xyz" into A
>   add 7 to A
> 
> Will return an error as 'A' is not a number.

... I think this is because Transcript does not have "pointers" 
available the same way other (programming) languages do. Again: The 
problem is (in my eyes) the ambivalence of Transcript sitting between 
human language (but not using it really, as synonyms would have to work 
then) and programming languages (but not using them as "standard" would 
have to be working then).

> I would offer that Transcript
> (and all xtalk for that matter) does not use redundancy to gain clearness,
> but instead uses redundancy to gain flexibility.

I see your point, but have to disagree: If it was for flexibility, 
Transcript would accept tokens to be LEFT OUT, which is not the case (as 
far as I understand the docs, that is: You have to use filling words in 
special cases like "put *the* location of something into myNose"). 
Flexibility would allow to say "put something's location into myNose" 
(allowing a "human language" short term like the genitive apostroph to 
be used).

I am not trying to argue against Transcript (just to make this clear 
once again), I just "stumbled" over "add 1 to pointer" being clearer 
than common programming code (pointer++). In my eyes, second to the 
somewhat irritating trial to be what a programming language should not 
be (inter-human communication), a difference in expectations WHO the 
reader (and writer) of code is may be the basic for this discussion: I 
expect a "professional developer" to be familiar with constructs like 
"counter++". This specific type of half-human-being would have to read 
more words and make a more complex interpretation (just like the runtime 
interpreter of Revolution) if he had to read "add 1 to counter", he 
would have to translate it into what the machine actually does 
(INCREMENTING a value - not "adding 1"). That's at least one step more, 
and developers, to my experience, are LAZY, if anything :-)

Marc Albrecht
A.C.T. / Level-2
Glinder Str. 2
27432 Ebersdorf
Deutschland
Tel. (+49) (0)4765-830060
Fax. (+49) (0)4765-830064


More information about the use-livecode mailing list