This topic is about the preserving input.

Here are about eight examples of different algorithms or methods (headers only).

Each algorithm receives zero to many input arguments or "input parameters".
Let us look at a couple examples to find out.
Let's assume we are doing the logic for a "BankAccount" type object.

Let's take a look at the "makeDeposit" algorithm.

This algorithm receives one input argument "depositAmount" and adjusts the balance by the "depositAmount".

This algorithm is okay.
makeDeposit(depositAmount) {
	//This algorithm updates a savings
	//account by adding a "depositAmount" that
	//is provided
	//We would do something like this
	this.balance += depositAmount
}
An example call to our algorithm is shown (a deposit of $,1000).
aBankAccount.makeDeposit(1000)
This algorithm receives one input argument "depositAmount" and adjusts the balance by the "depositAmount".

This algorithm is incorrect because we modified the input value.

The "caller" told us to deposit "depositAmount", but we ignored the caller's request and changed the deposit to $-100 (not good).
makeDeposit(depositAmount) {
	//This algorithm updates a savings
	//account by adding a "depositAmount" that
	//is provided
	//We would do something like this
	let depositAmount = -100
	this.balance += depositAmount
}
Here we look at an algorithm for "changePassword(newPassword)" which receives one input argument "newPassword".

This algorithm is incorrect because we modified the input value.

In this case we override the input and arbitrarily assign a different password = 'X'.
changePassword(newPassword) {
	//This algorithm sets a new password in a UserProfile object.
	let newPassword = 'X'
	this.password = newPassword
}
Conclusion: We want to preserve (not touch) input arguments.

End users (and client objects) do like software surprises.
Preserve Input