In: Computer Science
2 Explicitly-typed vs. implicitly-typed PLs
In explicit-typed PLs, the programmer is supposed to annotate each
data container with some type. This is
while, in implicitly-typed PLs there is not such restriction for
the programmer. Compare how this language
feature affects the following criteria:
syntax conciseness,
maintainability, and
expressiveness
explicit typed - these type of programming languages have the
variables which define data types at time time of
declaration.
implicit typed - these type of programming languages have the
variables without any data type
syntax conciseness:
It plays a major role in both explicit typed and
implicit typed as it define the clear meaning of variable names.
The variables have to be defined with clear names such that they
should be related to the concept in which they are working.For
example while calculating area of a square
we use the variables such as area and side where area defines the
area of square and the side defines the length of side of the
square.so if the variables are defined like this any one by just
looking at it they can understand easily.while naming the varaibles
there are certain rules that must be followed like if there are two
words in a variable the must be separated with underscore (since
space is not allowed).
maintainability:
it is the concepts which relates to the memory.in
explicit typed PL's since the variables are defined earlier with
data types it is very easy for the system to give memory to the
variables based on the given data types.In implicit typed PL's
allocating memory is a tough task for the system.
even in implicit typed PL's also some things should be initialized
properly.for example consider C++ which is explicit typed and if
you want to declare string we use keyword string and then variable
name(eg: String string_variable) and in python it should be
initialized like string_Variable = ""
expressiveness:
It shows the readability of the code the explicit
typed PL's are very easy to read since the variables are declared
with data type the purpose of variable can be understood easily.The
programmer should be very careful while writing the code because if
they forgot to declare a variable in hurry it will give an error.In
implicit typed PL's there is no need of care for the data types the
programmers can just write whatever the logic comes into their mind
and even the code is also easy to read since the number of lines is
very less.
If you have any doubts please comment and please don't dislike.