Sunteți pe pagina 1din 2

Chapter 4

A good programming language :

1. enables the programmer to state, with a low probability of error


2. Forces the programmer into the discipline of formatting his thoughts according to the computer language framework
3. Increase the clarity of thought and consequently improve the quality of the resulting software.

Small well understood activity

Lexical conventions understandable


block structured or compound statements - format
Data types - variable
control structures statement choice
Subprograms module by module

Large problematic issue of managing complex systems

information hiding - encapsulation of a program's data


separate compilation compiled modules separately
abstract data types module name & give operation to the type
OOP overcome ADTs
Reusability reuse the code

SMALL JAVA/C/CC++

1.Lexical conventions -Programs are written once but read many times

Solutions:

Readability use names that are meaningful


Not restrict the length of identifiers
Form of name can be improved separator, mixing upper and lower case

2.Block structured or compound statement

C and Java
Fully compound statement
Some uses ; as statement terminator

3.Data types: C and Java allows constants, types, variables and functions to be defined. Besides, Java allows classes and packages to be defined

i.Discrete types ii. Real numbers(float),double, long double(c)

iii. Structured data type

Java supports arrays while C support arrays & records


Both use conventional square brackets
A data type for a record composed of multiple components

iv. Dynamic data types

A structure that can expand and contract as a program executes.


C allows pointers while Java have records

4.Control structures

A combination of individual instructions into a single logical unit with one entry point and one exit point
To control the flow of execution in a program or function.
Categorized into sequences, decisions and loops.
i. Sequence structures
The sequential execution of statements is the normal activity of a programming language.
Most languages, including Java and C, implicitly require sequential execution, and no specific control structure is provided.
The definition of a block in both Java and C indicate that between ({) and end (}) there is a sequence of statements

ii. Decission structures

The most common form of decision structure is the if else statement


The decision as to which route is taken will depend upon the current values of relevant data objects
The important property of a decision control structure is that all routes eventually come back together
iii. Loop structures

Allows the programmer to specify that a statement, or collection of statements, is to be executed more than once
There are 2 distinct forms for constructing such loops: recursion, iteration

iv. Subprograms: use of procedures and function

Involves 3 distinct modes of transfer:

Data is passed into the subprogram


Data is passed out from the subprogram
Data is passed into the subprogram, is changed and is then passed out of the subprogram

LARGE : Important methods that can be used to manage the complexity characteristics of large embedded system

Information Hiding: Supports reduced visibility by allowing information to be hidden inside the modules body

Separate compilation: only files which have been edited since the last compilation need to be re-compiled when re-building the program

OOP (Overcome ADT properties)

1.Inheritance: Type extensibility : a way to form new classesa

Superclass - class from which other classes are derived. Subclasses - classes that are derived from a superclass

Reusability -Reusable code :Reduce cost & improve reliability

General purpose computer languages: Languages , Be portable, Be modular, Lend themselves to being debugged & compiled separately

Real Time Programming languages

1. Require deadlines : Specify priorities and run time requirements


2. Interact with devices of widely varying cycle times
3. Highly reliable
4. Improve readability
5. Portability
6. Flexibility
7. Schedulability
8. Modularity

CONCURRENT PROGRAMMING: techniques for expressing potential parallelism and solving the resulting synchronization & communication problems/ Reducing
the software construction costs.

3 levels of executions of computer instructions: CPU LEVEL, OS LEVEL, APPLICATION LEVEL

Processes: concurrency between programs

Tasks: concurrency within a program

S-ar putea să vă placă și