Program Design Language (PDL)
Program Design Language (PDL), also known as pseudocode, is a structured, English-like language used to express the logic of a program or module before actual coding begins. It bridges the gap between design documents and implementation code.
PDL Constructs
Sequence:
statement 1
statement 2
statement 3
IF-THEN-ELSE:
IF condition THEN
action
ELSE IF condition THEN
action
ELSE
action
ENDIF
WHILE Loop:
WHILE condition DO
action
ENDWHILE
FOR Loop:
FOR index = start TO end DO
action
ENDFOR
REPEAT-UNTIL:
REPEAT
action
UNTIL condition
CASE:
CASE expression OF
value1: action
value2: action
DEFAULT: action
ENDCASE
PDL Example: Student Grade Calculator
MODULE CalculateGrade
INPUT: studentMarks
IF studentMarks >= 90 THEN
grade = "A"
ELSE IF studentMarks >= 80 THEN
grade = "B"
ELSE IF studentMarks >= 70 THEN
grade = "C"
ELSE IF studentMarks >= 60 THEN
grade = "D"
ELSE
grade = "F"
ENDIF
IF grade == "F" THEN
WRITE "Student must retake the course"
ELSE
WRITE "Congratulations! Grade:", grade
ENDIF
END MODULE
PDL vs Pseudocode vs Programming Language
| Aspect | PDL | Programming Language |
|---|---|---|
| Formality | Semi-formal | Formal |
| Executable | No | Yes |
| Audience | Analysts, designers, programmers | Programmers |
| Detail | Logic only, no syntax | Full syntax and implementation |
Benefits of Using PDL
- Forces designers to think through logic before coding
- Easy to read and understand by non-programmers
- Language-independent (not tied to any specific programming language)
- Facilitates early review and debugging of logic
- Serves as documentation for the implemented code
Summary
PDL is a powerful design tool that helps analysts and developers express program logic clearly and consistently. It improves code quality by encouraging thorough design before implementation.