.Net Compilers

Introduction

On the basis of data type management the software development environment is classified into two types, one is loosely typed environments and the other is strongly typed environments.

Loosely typed environment

Within a loosely typed environment, you can store multiple types of data with a single variable.

For example, a variable on one line of code may have the date time value and on the very next line of code the same variable may have a stream value within it. Loosely typed environments cannot enforce type safety. This type of environment cannot guarantee this because they allow each variable to accommodate any type of data that can be stored within it. In addition, loosely typed environments do not use memory very efficiently, because a variable can accommodate any possible type of value. In such a case, when a variable is initialized or declared the compiler allocates a large portion of memory for each variable.

Strongly typed environment

In a strongly typed environment, every variable is explicitly assigned a datatype when it is declared. Only data accomodated by the assigned datatype is allowed to be stored in a variable. Therefore a strongly typed environment can ensure type safety. A strongly typed environment assigns and allocateds memory to a variable that can accommodate only the data type assigned to that variable.This makes a strongly type environment much more efficient than a loosely typed environment

Note

Type Safety:Type safety means the environment can guarantee that there is only a specified type of data in a memory location or at a given time.


Similar Articles