counter++ versus "add 1 to counter"

Ken Ray kray at sonsothunder.com
Sun Mar 21 12:41:32 EST 2004


Marc,

> > 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".

I appreciate the dialogue here, but it seems to me that it is based on past
experience and level of comfort. If I had spent a lot of time doing assembly
language or low-level development, "counter++" would certainly make more
sense than "add 1 to counter" (and btw, "put counter+1 into counter" also
works). 

Since Revolution is not targeted at low level programmers, but is more
targeted at other 4GL programmers (people who have worked with Visual Basic,
Macromedia Director, Flash, etc.) and people who haven't had much
programming experience in the past and "just want to get the job done", I
would argue that once the knowledge that "counter" is a variable becomes
apparent, "add 1 to counter" is quite understandable.

For example, which is more understandable in a spoken conversation?

  Harry: "Pick a number from 1 to 100."
  Steve: "OK, got it."
  Harry: "Now add 1 to it."

  Harry: "Pick a number from 1 to 100."
  Steve: "OK, got it."
  Harry: "Increment that number by 1."

Similarly, you have the same thing the other way:

  Harry: "Pick a number from 1 to 100."
  Steve: "OK, got it."
  Harry: "Now subtract 1 from it."

  Harry: "Pick a number from 1 to 100."
  Steve: "OK, got it."
  Harry: "Decrement that number by 1."

And this is my point... in a conversation between C++ or assembly
programmers, they are probably the same. ;-)  But to higher-level language
developers and novices, there's quite a difference.

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/




More information about the use-livecode mailing list