A team using Matlab to manage experimental scenarios needed a simple way to generate and store participant-specific images, but constraints around their database and Matlab license left no clean solution. A developer named Jude wrote a state-machine-style trigger-parsing script full of convoluted case logic and self-deprecating comments to reconstruct experiment patterns from log data. The code relies on counting stimuli rather than directly referencing responses, uses a for-loop with a switch statement (the classic 'for-case' antipattern), and includes comments admitting uncertainty about correctness. It later turned out 20% of the provided logs belonged to entirely different, unrelated experiments.
194 Impressions