Subroutines and Structured Programming

studied byStudied by 3 people
0.0(0)
Get a hint
Hint

Subroutine

1 / 23

24 Terms

1

Subroutine

A named 'out of line' block of code that can be executed by simply writing its name in a program statement.

New cards
2

Procedures

Subroutines that perform actions but do not return a value.

New cards
3

Functions

Subroutines that perform actions and return a value.

New cards
4

Code Reusability

Writing code once and using it multiple times without rewriting.

New cards
5

Modularity

Breaking programs into manageable sections where each subroutine performs a specific task.

New cards
6

Simplified Maintenance

Easier updating and fixing of code with changes in a subroutine affecting all calls to it.

New cards
7

Improved Readability

Making code more organized and understandable by giving structure and clarity.

New cards
8

Enhanced Collaboration

Allowing different programmers to work on different subroutines simultaneously, particularly useful in large projects.

New cards
9

Parameters

Variables listed as part of a subroutine's definition to pass data into the subroutine.

New cards
10

By Value

Passing a copy of the data to the subroutine.

New cards
11

By Reference

Passing a reference to the actual data, allowing modifications.

New cards
12

Returning a Value

Subroutines can return a value to the calling routine using the return statement.

New cards
13

Local Variables

Variables declared within a subroutine, accessible only within that subroutine.

New cards
14

Encapsulation

Keeping variables confined to the subroutine to prevent interference with other parts of the program.

New cards
15

Memory Management

Local variables are automatically destroyed when the subroutine finishes execution.

New cards
16

Structured Approach

A method of programming that emphasizes breaking a program into smaller, manageable, and reusable modules or subroutines.

New cards
17

Modularization

Dividing the program into distinct subroutines.

New cards
18

Clear Interfaces

Using parameters and return values to define clear inputs and outputs for subroutines.

New cards
19

Documentation

Well-documented code with comments and clear variable names.

New cards
20

Improved Code Organization

Making large programs easier to understand and manage through a structured approach.

New cards
21

Enhanced Debugging and Testing

Easier testing of individual modules for improved debugging.

New cards
22

Facilitates Teamwork

Enabling different team members to work on separate modules simultaneously.

New cards
23

Scalability

Simplifying the process of adding new features or making changes.

New cards
24

Reuse of Code

Reusing subroutines in different parts of the program or in different programs.

New cards

Explore top notes

note Note
studied byStudied by 18 people
... ago
4.0(1)
note Note
studied byStudied by 12 people
... ago
5.0(1)
note Note
studied byStudied by 34 people
... ago
5.0(1)
note Note
studied byStudied by 13 people
... ago
5.0(2)
note Note
studied byStudied by 1 person
... ago
5.0(1)
note Note
studied byStudied by 57 people
... ago
5.0(1)
note Note
studied byStudied by 22 people
... ago
5.0(1)
note Note
studied byStudied by 1975 people
... ago
4.7(11)

Explore top flashcards

flashcards Flashcard (93)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (115)
studied byStudied by 13 people
... ago
5.0(2)
flashcards Flashcard (22)
studied byStudied by 17 people
... ago
5.0(3)
flashcards Flashcard (75)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (29)
studied byStudied by 27 people
... ago
5.0(2)
flashcards Flashcard (40)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (134)
studied byStudied by 2615 people
... ago
4.0(26)
robot