counter++ versus "add 1 to counter"
A.C.T.
albrecht at act-net.com
Sun Mar 21 13:01:16 EST 2004
Hi, Ken - and Mark,
> For example, which is more understandable in a spoken conversation?
... that's my point: We are talking about developing programs, not
narrative stories.
> I *do* find that many functions that I'm converting from some other
> language are unnecessary, as they're already present in Transcript, or
> they can be coded in much fewer lines and in either case become more
> readable code.
Most likely true - just as the oposite: Why isn't "basename" or
"dirname" present, both being substantial functions for everyone who is
dealing with files all day? No, don't answer it, it's just an example to
show: Everyone has a specific environment he comes from. Telling him
he's "silly" doesn't prove you right:
> This is just silly. "1" is a defined constant. In your example, would
> you consider "counter++" to be adding 1 banana to counter?
If you replace "1" with "orange" (meaning: a variable) in "add 1 to
many" you COULD mean "add everything in variable orange to the contents
of variable banana"- a "concat action". PLEASE understand that I don't
mean this "serious", it's just a sample to make you understand that
"human language" is NOT "programming language". It simply isn't true
that my 12-year-old-daughter (being German just like me) could code
Transcript more easily than PHP if she has got basic programming skills.
She would a) have to understand English quite well and b) have to
understand the specific restrictions of Transcript-English. She would
always be puzzled whether Transcript would UNDERSTAND what she tries to
express (in English), wheras using standard coding phrases are clear,
once you learned them "as words" - like "counter++".
The question here was whether "add 1 to counter" is clearer than
"counter++". It is NOT, except for a couple of million people speaking
English. Ask a Chinese which one is clearer - I guess, if she doesn't
understand English at all, the only problem she would have would be
"what's a counter?". "counter++" - or $4a or "inca" are "words" that can
be learned as "static language components". A language always should try
to be "precise", so a programming language has all rights to have its
own "tricks". Trying to "soap up" a programming language by using "human
code" does NOT make things clearer, it only puts color on the front and
creates the "effect" of being easier to understand.
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