I'm looking to stop lurking the stack exchange community and actually participate a little more.

A little background, I am a student in University in my freshman year of my Computer Information Systems - Programming Track Degree.

So this issue I have occurred about a week ago in my freshman visual basic class. Now I have been programming on/off since I was 11, so I knew quite a bit of the basics already. I understand that I am a little farther ahead than some of the students, but I don't ever talk about it or show off. I am very reserved about that kind of stuff.

Actually, this instance was the first time I openly talked in the class and asked a question. We were assigned a lab to add up every integer between 1 and the number entered by the user, and then display the sum. So if the user entered 10, it would display 5050. No big deal, so I get started.

Now this is where the issue happened. I realized that the user could enter a large number and cause an overflow error if we just used Int32s, which was all he went over in the class. I wanna figure out if he wants us to use Longs so we can calculate those higher numbers, or if he just wants to use Ints and catch the overflow.

So here I am, hand raised, about to ask the first question I have ever asked in this class. I said something along the lines of, "Would you prefer us to use Longs or to use Int32s and just catch for overflow."

I kid you not the response I got from the class literally made me slide down in my chair. The Professor starts laughing and says "Use Int32s without checking for overflow." And the whole class around me starting giving me weird looks and some even vocalized, "Why would you do that?", "That's stupid", etc.

In my head, my question made complete sense. I mean, I'm not going to claim to be a programming god, but I thought that by now I had basic stuff like checking for errors understood. Why would not encourage us to do that / am I just being stupid?

All I know is that I was extremely embarrassed.

PS : He did already go over Try Catch in the class, and the Long data type. So the class would have the knowledge to check as long as they knew what an Overflow error specifically was.

TL;DR - I asked if we should check for overflow in a program in my class, Professor and whole class acted like I was crazy. I feel embarrassed. Did I do something wrong?

  • 7
    If you can get over the fear of feeling stupid in front of your peers for asking questions then you will likely learn much more than those who were too afraid to ask. – Harry Feb 24 '17 at 21:55
  • 11
    Your example doesn't add up to 5050.... 1+2+3+4+5+6+7+8+9+10 = 55 – Michael Feb 24 '17 at 22:26
  • 3
    Is it possible that you misread the situation? I have been teaching (introductory) programming subjects for a few years now, and I deem it extremely unlikely that this kind of question would evoke the response you describe. Is it possible that the laughter was not (directly) due to the question itself, and/or that the student's comments was about something else? – xLeitix Feb 24 '17 at 22:58
  • 3
    I suggest you edit this down to the question you want to ask. The details you provide about computer science will not mean anything to users here with no background in CS. And there's no real question here other than "Am I crazy?" in the subject line. But this is not a CS forum, so we can't be expected to evaluate the craziness of your CS question. – Sverre Feb 24 '17 at 23:30
  • 3
    I will just say that for me, this is a very believable and easy situation to read. The exercise is obviously an introductory loop with accumulator; these are commonly asked glossing over error conditions. The instructor chuckled because of how unusually advanced the question was. The other students did not understand and misinterpreted the chuckling as indicating a stupid question. OP does need to get a thicker skin for this kind of interaction. – Daniel R. Collins Feb 26 '17 at 4:35

Assuming that there are no missing information on the situation:

Your question does make perfect sense. Overflows are a serious flaw that can lead to security problems, not a laughing matter.

However, I can see myself leading the students to an overflow as motivation to explain how to deal with them, that might include answering your question with the same words your professor used (to not disrupt the 'plan' for the topic - Indeed, I did that a couple of times already).

This would not, however, include me laughing (a smirk maybe), and I would certainly not tolerate that reaction from your colleagues, which would lead me to reveal what I was planning and that your question was not only valid, but the point of the whole thing.

Ignore the reaction of the class. Herd mentality... As if they knew any better :)

On a side note, who teaches visual basic nowadays? :)

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.