Why him does not use a natural language for programming?

Bob Sneidar bobs at twft.com
Thu Feb 23 19:46:17 EST 2012


Well the goal of Hypertext based programming was and is to make the programming language as like a normal dialect as possible, so code would be easier to read and write. This by nature causes a certain degree of verbosity. Obviously:

theTruth = iif(true,true,iif(true,true,false)) 

is quite a bit less verbose than:

if true then
  put true into theTruth
else
  if true then
    put true into theTruth
  else
    put false into theTruth
  end if
end if

But replace those trues and falses with real commands and functions and the first case becomes a pig to follow while the second does not have to be so. Another way to put it is that the goals of writing compact code is naturally at odds with the goals of hypertext based programming. 

there is some shorthand you can employ in LC. Object types can be abbreviated for instance. Instead of background you can use bg. Instead of foregroundColor you can use foreColor or fillFore. bottomRight becomes botRight and so on. So:

set foreColor of fld "myField" to blue

is not all that tedious, and I find it quicker and easier to code this way. Also, many here who have experience in other languages will tell you that the amount of code required to do almost anything in LC is far, far less than in other environments. Remember, we do not have to write the code that creates fields, buttons, menus etc. neither do we have to write the engine that sends messages to them and interprets user interaction for us. Most of the work has already been done for us! Now THAT is what I call Compact Coding!!

Bob


On Feb 23, 2012, at 4:13 PM, Michael Chean wrote:

> His first argument re: ambiguity doesn't hold water for me.  Anyone who has
> tried to decipher another
> persons code can attest to how ambiguous programming languages can be.
> The second argument though, due to my recent exposure to LiveCode, I find
> true.  LiveCode is verbose.
> As I've mentioned in another thread there should be a shorthand.  I
> mentioned the use of 'with' to
> avoid the repetition of the context of a loop.  There must be other places
> where this might be applied, and perhaps
> it's my inexperience talking that I'm not aware of them.  Further leaving
> off words like 'the' in the script
> cause the line to not compile, with a not very clear error.  This was a
> real eye opener for me, and not a very pleasant one.  Please correct me if
> I'm wrong here btw.
> 
> Mike





More information about the use-livecode mailing list