COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Data is exposed to whole program, so no security for data. This statement refer to which paradigm?
A
Object-oriented
B
Logic
C
Procedural
D
None of the above
Explanation: 

Detailed explanation-1: -The procedural programming paradigm is where program code is divided up into procedures, which are discrete blocks of code that carry out a single task. Procedures, also called subroutines or functions, contain a series of computational steps to be carried out in the order specified by the programmer.

Detailed explanation-2: -Unlike OOP, where data and methods were tied together (encapsulated) in a class or object, procedural programming uses data and methods as two different entities. As a result, there is no concept of access specifiers here, making this paradigm less secure than OOP.

Detailed explanation-3: -Examples of procedural programming are FORTRAN, ALGOL, COBOL, BASIC, Pascal, and C.

Detailed explanation-4: -Procedural Programming divides the program into small programs and refers to them as functions. Object Oriented Programming divides the program into small parts and refers to them as objects. Available data is capable of moving freely within the system from one function to another.

There is 1 question to complete.