The small difference between OK Code and Good Code

time to read 1 min | 130 words

This is OK code:

def LockItem(itemKey as string):
	while true:
		result = PUT( "lock of "+itemKey, "requiredValue" )
		break if result is SuccessfulUpdate
		// we don't sleep, the remote call take care of spacing the calls in time

And this is good code:

def LockItem(itemKey as string):
	while true:
		result = PUT( "lock of "+itemKey, clientName )
		break if result is SuccessfulUpdate
		// we don't sleep, the remote call take care of spacing the calls in time

The only difference is with the value we set, and that is never used by the application.

Why is this important?