- Advantage: write ability
- Disadvantage: reliability (less trouble with Perl)
Static Type Binding
Implicit Declaration in Perl
•Any name begins with $ is a scalar, which
can store either a string or a numeric value
•A name begins with @ is an array
•A name begins with a % is a hash structure
- A variable is bound to a type when it is assigned a value in an assignment statement (at run time, take the type of the value on the right-hand side)
- Ex. for dynamic type binding in JavaScript
list = [2, 4.33, 6, 8]; list = 17.3; - Advantage: flexibility (generic program units)
- Disadvantages:
- High cost (dynamic type checking and interpretation)
Share with your friends: |