Programming Languages Flashcards
Second-generation : Assembly language
A mnemonic system for representing machine instructions
+Mnemonic names for op-codes
+Program variables or identifiers : Descriptive names for memory locations, chosen by the programmer
Assembly Language Characteristics
One-to-one correspondence between machine instructions and assembly instructions
+Programmer must think like the machine
Inherently machine-dependent
Converted to machine language by a program called an assembler
Third Generation Language
Uses high-level primitives
Machine independent (mostly)
Examples : FORTRAN, COBOL
Each primitive corresponds to a sequence of machine language instructions
Converted to machine language by a program called compiler
Fourth Generation Language
There is no obvious difference between 3. and 4. gen PLs
Process is short
Spelled as Fourth GL (“procedural language”)
Each step is defined and executed
Fourth GLs has own query languages
+SQL (structured query language)
Screen painter/designer
Application generators
Report generators
Procedural Units*
Many terms for this concept :
-Subprogram, subroutine, procedure, method, function
Unit begins with the function’s header
Local vs. Global Variables
Formal versus Actual Parameters
Passing parameters by value versus reference
Program design aims
Reliability
Maintainability
Portability
Readability
Performance
Storage Saving
Basic Coding Principles
Declarations : Yeterince uzun ve anlamlı değişken adları
Indentation : Girintili yazı yazma
Structures : Appropriate structures should be used
Length :Subprograms in the program must be arranged in managale lengths
Descriptions :Tanımlayıcı bilgiler programda yazmalı
Translators
Assembler : A program that transfers assembly language into machine code
Compiler : A program that translates a high-level language into a machine-oriented language, pften machine code
Interpreter : A program which translates and executes each source statement in logical sequence as the program is executed
Compiler
Controls all program in one step
Checks lexical and syntatical errors
If no error is found, then the program is converted into object code
The object code is converted to executable code
Interpreter
Checks all program statement by statement
All statements in a loop are converted repeatedly
Slow…
Objects and Classes
Object : Active program unit containing both data and procedures
Class : A template from which onjects are constructed
An object is called an instance of the class
Components of an Object
Instance Variable : Variable within an object
+Holds information within the object
Method : Procedure within an object
+Describes the actions that the object can perform
Constructor : Special method used to initialize a new object when it is first constructed
Object Integrity
Encapsulation : A way of restricting access to the internal components of an object
+Private
+Public
Inheritance and Polymorphism
Inheritance : Allows new classes to be defined in terms of previously defined classes
Polymorphism : Allows method calls to be interpreted by the object that recieves the call
Programming Concurrent Activities
Parallel (or Concurrent) processing : simultaneous execution of multiple processes
+True concurrent processing requires multiple CPUs
+Can be simulated using time-sharing with a single CPU