Actions

Computer Science structure definition

From Santa Fe Institute Events Wiki

Back to the structure definitions wiki page

To begin, I (Adam) will discuss programming structure. These are my own definitions and intuitions about structures of human-written programs and are not rigorously defined. Typically, a program's structure is defined by its modularity, consistency, and level of abstraction.

Modularity describes how redundancy is eliminated from the program. For example, if I have to sort an array of numbers 10 times, then I shouldn't write the sorting code 10 different times. I should write it one time in a function and call that function from the 10 locations. This way, if there is something wrong with my sorting routine, I only have to modify it once. Also, I can reuse the code in any other place in my program. This example is obvious, but sometimes it's not so clear when a new function should be defined, or if code should just be "copied and pasted".

Consistent programming practices, such as indentation guidelines, variable naming, etc., can make programs more readable by others or even the author of the program. Maintainability becomes an issue when naming conventions are not followed.

The right level of abstraction within a program can make maintaining the code much easier. If the program is designed and structured well, then adding new features can be easy. However, if the programmer did not plan for future modifications to the code, then additions to the program may be very difficult.

This is just a start, and I will add more to this later. I hope to add some more formal definitions of programming structure.