Consider that as a lecturer every your word will carry a meaning. Even an innocuous remark may turn out to be something that will stick with one of your pupils for years and will lead them to make a sequence of wrong decisions that will eventually ruin their life.
Having access to younger minds and influencing their personal and professional development is not a joke. It's that kind of a job which if not done properly may potentially produce the next tyrant.
Generally speaking, a person only begins to reach psychological maturity at around 30 years of age. Until that time all incoming ideas generally fall on a fertile ground, as the person is not yet capable of telling bad apples from the good ones apart and can't always discard the wrong ideas. Sometimes it's exactly those ideas that take and derail somebody's life, unnoticeably, one step at a time.
I asked him why he wasn't just storing it in a hash table instead. His answer: "Because I sometimes need to iterate over it and get both the key and the value"
My brain had to sit and parse what he'd said for a few moments, before I realized what the heck he was talking about. In all of the data structure courses, he'd been taught "A hash table hashes the key, and stores the value in the corresponding slot". In that mental model, there's no way to retrieve the key, only to retrieve the value given the key.
I explained to him that real-world implementations do do that, but also store the key along-side the value, so that you can still iterate across it. You could see the look of amazement wash over him, and then he frustratingly declared "Why the hell didn't they mention that?!"
And yes, when you've got a complete understanding, it seems quite obvious that the key has to be stored with it. That's why I got it. He'd just learned it though, and there were still those gaps in his knowledge that he would have carried for a long time until someone else helped point out the missing piece (or he had decided to sit through and make sure he understood everything)
DISCLAIMER IAMA academic
Grandparent. Two posts up the hierarchy from the person who used the term "GP".
So this is a personal attack then. Frankly, I expected better from the HN community. It looked more evolved when I was just an occasional visitor prior to joining. Rather disappointing.
Anyway, I appreciate your viewpoint.
It seemed like a bit of a snipe maybe (or a joke where they forgot the smiley). I went back and re-read your original "GP" comment and it seemed like you had encountered a number of students who had trouble as a result of such teaching. The snipe implied your experience was just your own personal problem, which seems false in looking at it again. Relax, it's just people you don't know responding to someone they don't know.