Professor and Class Laughed When Asking About Overflow In Project. Did I do something wrong? 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?
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? :)