Professors have no reputation for writing good code. Academic code is fairly notorious for being under abstracted, hard to follow, messy, etc.
If a passerby told me this story I’d have the same guess though!