Pascal is a procedural programming language designed in 1968-1969 and published in 1970 by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring.
Pascal Anti-Patterns Overview
Using GOTO Statements
GOTO
statements, which make code difficult to understand and maintain. Use structured control flow constructs like for
, while
, repeat-until
, and if-then-else
instead.Not Using Strong Typing
Using Global Variables
Not Using Proper Error Handling
try-except-finally
blocks (in modern Pascal) to handle exceptions and ensure resources are properly cleaned up, even when errors occur.Using Magic Numbers
Not Using Proper Resource Management
try-finally
blocks to guarantee cleanup code is executed.Not Using Proper Data Structures
Not Using Units for Code Organization
Not Using Strong Type Definitions
Not Using Function Results
var
parameters for outputs. This makes the code more readable and allows for function composition.Not Using Proper String Handling
Not Using Proper Documentation
Not Using Proper Object-Oriented Design