Confronted professor for he misunderstanding my work. Didn't end well.

“If you plan on getting a job in CS, you have to complete it the way the customer wants it.”
And with nice, sleek, economical code, not just what makes sense to you. The next person has to be able to read it, use it and debug any issues. Lots of thinking points here.

I agree OP came off pretty hot, but I can accept that maybe it was a leaping vent on this thread, rather than cautiously worded. So another lesson is to breathe and think, before jumping- with the prof, with the world.

People being smarter than their higher-ups is a phenomenon which sometimes happens (I don’t know if you are a part of that phenomenon or not). But only the best of the latter can handle knowing it.

Kudos to you for coming up with an alternate solution on your own (or at least trying to). Civilization did not soar until people stopped simply copying each other.

Do not continue to expect understanding from this professor.

Again, thank you all for taking the time to read and comment.
Just like most of you said, even if I was right, the way I handled it was completely inappropriate and unprofessional.
I would take a lesson from this and in the future know how to deal with arguments and misunderstandings better.

I had already sent the professor an email to apologize (thanks to you guys!). Even if one day he did come across on this forum and saw my immature posts, I think and hope he’ll understand.

In the past I had a history of sucking up when being mistreated. One of my bosses once told me she was worried about me because I barely stood up for myself, and my boyfriend said the same thing. (Perfect example: in one of my gen sci courses, the prof probably had prejudice or discrimination against me, that she gave me unreasonably low grades e.g. 67 on final paper, and that was the only course I didn’t end up with an A so far in school. Most people I know, including other professors I’ve talked to, suggested me to appeal this grade. But I didn’t do it because I was too timid to. When I made up my courage to talk to that professor I just burst out crying in front of her, and of course that didn’t fix anything.)

So recently, I have started to try to express my opinions more, but it isn’t always easy, as I would sometimes get too emotional in the process. (Or being too aggressive, in this case.)

“Even if I was right” – a decision tree works with a fairly simple problem, but it can get too complex to use that method. You haven’t addressed whether you understand the method the prof uses and WHEN it is most appropriate. I am not sure this is just an issue of him it listening to you…