for Robot Artificial Inteligence

40.Structed programming

|

Structed programming

  • structed programming(sometimes known as modular Programming) is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify

  • structed programs makes extensive use of the program control structure such as sequence, decision / selection and repetition like loops

  • Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and looping structure like while loop and for loops

  • structured programming make bare minimum use of the jump statements such as the go to statement which could lead to “spaghetti code” causing difficulty to both follow and maintain.

  • structured programming is language independent and any programming language can implement the structed programming but with procedural languages it is much easier.

  • almost any language can use structed programming techniques to avoid common problems associated with unstructured languages.

  • in unstructured programming the onus is on the programmer to properly organize the code during development avoid any structural problems.

  • structured programming is based on a top-down design model in which programmer has to split the overall program structure into separate independent sub-sections referred as modules.

  • A set of similar functions are grouped together in a separate module or sub-module. there modules can be independently coded and loaded into the memory more efficiently. these modules can be reused in other programs by integrating with overall program structure.

  • the modular programming has a main module and many sub-modules. the main module is compiled as an executable file(filename.exe)

  • Each sub-module represents a single Or group of functions the main module is first executed sequentially from top to bottom. the main module then calls the Sub modules functions one by one.

  • the program is divided into modules and the modules are then divided into functions / methods.

  • each module is a self contained unit in the program and changes can be done on one module without affecting the functionality of the other modules.

  • the usages of goto statement is removed or reduced to a bare minimum.

  • Each module can work independent of one another.

Comments