Computer Language Definitions and Intelligibility

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Computer Language Definitions and Intelligibility

Chris Muller
Hi Greg, I can relate to the challenge you've had in finding basic
definitions.  Even Wikipedia's entry on "late binding" seems overly
verbose and complicated, so let me give it a try.

In any computer program you work with objects like strings or numbers
or toys.  The program is a series of instructions that tell the
computer what to do with the objects, add two numbers, capitalize the
first character of a string, or move a toy to the left on the screen by
10 pixels.

But for programs of any length to make sense to humans, it is very
necessary to *name* the objects that you are working with.  For
example:

  total = price + salesTax

The unit of the program which *is* a name of an object is called a
"variable".

Binding refers to the fact that "total" refers to the result or price +
salesTax.  "Early" or "late" refers to WHEN the the variable is bound
to the result of their instructions.  In the above example, an "early"
binding would occur when the code was compiled, well before it is
executed.  

How could total be bound if we don't know the price and salesTax until
the program runs?  The answer is, its not the actual number but rather
an empty "slot" is made available internally in the program where it
knows it will store the result of price + salesTax.  The "total"
variable will always point only to this slot in memory and whatever
value is placed into that slot is what "total" will report to any
instruction asking for it when the program is run.

With late binding, the "slot" for the price + salesTax result is
created dynamically and the "total" variable is referred to it at
runtime right after that instruction executes.  

So late-binding provides run-time flexibility, early-binding does not.
It turns out that this flexibility allows programs to be much easier to
write, maintain because they are not so rigid.

Hope this helps, if I've mis-spoken someone please correct me.

Welcome to Squeak.


> Message: 5
> Date: Fri, 7 Jul 2006 13:28:53 -0700
> From: Greg Smith <[hidden email]>
> Subject: [Squeakland] Computer Language Definitions and
> Intelligibility
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> I just started reading Alan Kay's forward to the book,
>
> SQUEAK:
> OBJECT-ORIENTED
> DESIGN WITH
> MULTIMEDIA
> APPLICATIONS
>
> and came across the phrase, "extreme late binding".
>
> This presented the same problem I always seem to encounter when
> trying to learn any technical subject, from scratch.  Having no prior
> background in the subject under discussion, I have no familiarity
> with the insider lingo that inevitably exists in each and every text
> on the written on the subject.

_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Computer Language Definitions and Intelligibility

John Kershaw
Greg,

Don't worry about it. Binding asks "How soon do I have to decide what kind of 'thing' this variable represents?" which is important in some computer languages, but not in Squeak. Everything in Squeak is an object, whether (to you) it represents a number, a window or a wiggling worm 'sprite'. It's always just an object, so you can happily change it's perceived type whenever you like and Squeak won't mind.

If you tried the same thing in most other languages you'd get an error - if you created a variable as type 'integer' then tried to give it the value '7.3' your program would fail. Squeak wouldn't care :)

John.


> From: Greg Smith <[hidden email]>
> Subject: [Squeakland] Computer Language Definitions and
>       Intelligibility
> To: [hidden email]

> and came across the phrase, "extreme late binding".
>
> This presented the same problem I always seem to encounter when
> trying to learn any technical subject, from scratch.  Having no prior
> background in the subject under discussion, I have no familiarity
> with the insider lingo that inevitably exists in each and every text
> on the written on the subject.



_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland