Abstraction and Encapsulation

Simple Procedural

VS

Functional

Simple procedural languages do not support high levels of data abstraction and encapsulation. A simple procedural language such as FORTRAN did not develop its abstraction until the version Fortran 90 where record data structures were provided to be a basic way to incorporate data abstractions into the language. Simple procedural languages do not support the use of encapsulation. Like the simple procedural languages Fortran and Prolog still do not support data abstraction and encapsulation.

Simple procedural languages allow users to define abstract data types, but all objects within the abstract data type must be of the same type.  “Common block may be used to isolate global data to just a few subprograms needing the data.”

Functional languages for example, LISP, do not support-advanced data types such as classes. Linked list structures as well as some other data structures used in functional languages do not support data abstractions. “The language relies heavily upon simple data types and therefore has no great need for ADTs.” The primary data structure used in functional is a linked list structure. For example, in LISP, “using abstraction can simplify and shorten a large program and it is essential for recursive functions and avoiding any repetition of the same code. Functional language provides no real form of encapsulation as all data can be referenced through pointers. But, functional languages can compile functions into external files, which provide a form of encapsulation. While most languages and programming styles use procedural abstraction as a method of reducing program complexity, not all languages are optimized for data abstraction.”

Overall, neither simple procedural nor functional languages support high levels of abstraction.

 

Abstraction and Encapsulation

Functional

VS

Logic Based

Functional languages for instance LISP, do not support-advanced data types such as classes. Linked list structure as well as the rest of the data structures used in concordance with functional languages does not support data abstractions. These languages rely heavily upon simple data types and therefore have no great need for ADTs. The primary data structure used in functional languages such as LISP is the linked list structure. Resulting in the knowledge that object-based languages have a better handling of abstraction and encapsulation more over than functional languages themselves.

Logic-based languages often times do not support real abstraction because of their complex data structures, which are actually based on simple data structures of minuscule prepositions while the lists comprise a type of abstractions. “Encapsulation in logic-based languages can be accomplished by the use of structures and lists.”

Functional and Logic languages are not very strong in Abstraction and Encapsulation when they are compared to language groups like Object Oriented languages. “Functional languages make encapsulation and abstraction possible through the use of structures. The language relies heavily upon simple data types and therefore has no great need for ADTs. The primary data structure used in LISP is a linked list structure.”

“Logic-based languages generally support no real abstraction because complex data structures are actually based on simple data structures of atomic prepositions, while lists provide some kind of abstraction. The only encapsulation found in Logic Based Languages is through the use of selectors and lists. Structures provide a greater degree of abstraction.”

Functional languages are heavily abstracted. They can form abstractions by creating subprograms within a subprograms or programs. Outsized portions of the executable code of any functional programs are stored in external functions and libraries. A variety functions are currently available as encapsulations of standard functional language libraries. Too, Functional and Object-Based languages support weak encapsulation.