Skip to content

Instantly share code, notes, and snippets.

@searls
Last active July 24, 2023 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save searls/704ae6d13a2a4d2a6143cb8862e6ba42 to your computer and use it in GitHub Desktop.
Save searls/704ae6d13a2a4d2a6143cb8862e6ba42 to your computer and use it in GitHub Desktop.
A script for illustrating feedback loops completed given various conditions for a post on https://justin.searls.co
WORKDAY_HOURS = 8
LOOP_SPEED = 15
INCORRECT_EVERY = 25
LOW_FIDELITY_EVERY = 10
INCORRECT_LOOP_PENALTY = 3
LOW_FIDELITY_TIME_PENALTY = 2
time_remaining = WORKDAY_HOURS * 60 * 60
loops_attempted = 0
good_loops = 0
bad_loops = 0
bad_loop_penalty_remaining = 0
while time_remaining > 0
loops_attempted += 1
time_remaining -= LOOP_SPEED
if loops_attempted % INCORRECT_EVERY == 0
bad_loop_penalty_remaining += 1 + INCORRECT_LOOP_PENALTY
end
if loops_attempted % LOW_FIDELITY_EVERY == 0
time_remaining -= LOW_FIDELITY_TIME_PENALTY * 60
end
if bad_loop_penalty_remaining > 0
bad_loops += 1
bad_loop_penalty_remaining -= 1
else
good_loops += 1
end
end
puts <<~MSG.gsub(/\s+/, " ")
Programmer completes one feedback loop with their computer every
#{LOOP_SPEED} seconds. 1 in #{INCORRECT_EVERY} of their commands ask the
wrong question and result in the next #{INCORRECT_LOOP_PENALTY} questions
also being wrong. 1 in #{LOW_FIDELITY_EVERY} of their commands produce
low-fidelity results that cost them #{LOW_FIDELITY_TIME_PENALTY} minutes to
interpret the answer. **The programmer is able to complete #{good_loops}
productive feedback loops per day.**
MSG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment