Procedural code: Difference between revisions
m did you mean useful ? |
Link to anti-pattern |
||
Line 1: | Line 1: | ||
The '''Procedural code''' anti-pattern involves writing code by compiling all of the steps needed to accomplish a task in sequential order as opposed to abstracting the fundemental components of the task. This is like following a set of driving instructions as opposed to finding your way with a map. The driving directions are highly context sensitive and of little use to those who do not share the same point of origination or destination. The map, however, could be used in many different contexts and the components (streets, compass points, distances) could have many different applications. |
The '''Procedural code''' [[anti-pattern]] involves writing code by compiling all of the steps needed to accomplish a task in sequential order as opposed to abstracting the fundemental components of the task. This is like following a set of driving instructions as opposed to finding your way with a map. The driving directions are highly context sensitive and of little use to those who do not share the same point of origination or destination. The map, however, could be used in many different contexts and the components (streets, compass points, distances) could have many different applications. |
||
Procedural code is not necessarily unproductive in small scripts, or in moderation and at a high level in the code, in fact it could be argued that at some point there must be some [[procedural programming]] element to any useful software project. However, procedural code can become unmanageable in larger projects. |
Procedural code is not necessarily unproductive in small scripts, or in moderation and at a high level in the code, in fact it could be argued that at some point there must be some [[procedural programming]] element to any useful software project. However, procedural code can become unmanageable in larger projects. |
Revision as of 17:46, 20 November 2004
The Procedural code anti-pattern involves writing code by compiling all of the steps needed to accomplish a task in sequential order as opposed to abstracting the fundemental components of the task. This is like following a set of driving instructions as opposed to finding your way with a map. The driving directions are highly context sensitive and of little use to those who do not share the same point of origination or destination. The map, however, could be used in many different contexts and the components (streets, compass points, distances) could have many different applications.
Procedural code is not necessarily unproductive in small scripts, or in moderation and at a high level in the code, in fact it could be argued that at some point there must be some procedural programming element to any useful software project. However, procedural code can become unmanageable in larger projects.
Object-oriented and Declarative programming languages aim to avoid the pitfalls of procedural code.