2.2.1 Programming Techniques

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

Stopping condition/base case

condition that needs to be met to break the cycle of recursion

2
New cards

Advantages of recursion

Save time writing code

3
New cards

Disadvantages of recursion

More significant space requirements, danger of stack overflow, difficult to trace

4
New cards

Advantages of local variable

Ensures subroutines are self-contained, variable name can be recycled in other subroutines

5
New cards

Disadvantages of local variables

Can’t be accessed outside of subroutine

6
New cards

Advantages of global variables

Can be accessed anywhere in the program

7
New cards

Disadvantages of global variables

Require more memory (longer lifespan), can accidentally be overwritten

8
New cards

What is modular programming?

Split large program into small self-contained modules. Makes it easier to divide tasks amongst a team.

9
New cards

passing by value

A method of passing arguments to a function where a copy of the actual data is made, allowing the function to operate on the copy without modifying the original data.

10
New cards

passing by reference

A method of passing arguments to a function where a reference to the actual data is passed, allowing the function to modify the original data directly.

11
New cards

Advantages of splitting into sub-procedures

Procedures can be reused, program can be split amongst programmers, speed up completion time by working on multiple procedures concurrently, easier to test modules than whole code

12
New cards

Advantages of concurrent programming

Processes happening at the same time saves time, another task can be completed while waiting for user input for another

13
New cards

Disadvantages of concurrent processing

On a single core processor only one task is actually being processed at once, if tasks are dependent on each other they may need to be completed in order, trying to do a large number of tasks at once means it takes a long time before any of them are individually completed.