Today was my first university day, and my software engineering class left me with a bitter taste. The professor sure seems to know about design and design patterns and MVC and the like (it's going to be his topic), but when it comes to compiling and branch prediction he seems to be a little confused.
At some point he started to explain us why object-oriented programs are slower than imperative programs because object-oriented programs are interpreted while programs written in a non-OO language like, say, C, are compiled to machine code. He then proceeded to explain how modern compilers, like C compilers, try to guess which branch in a condition will be executed most of the time, and puts the first instructions of these branches before the
if block, and that's some kind of way of implementing instruction-level parallelism. He then told us that these compilers had to do educated guesses, but a JIT compiler, like modern Java JIT compilers, could profile your code and put the instructions of the most frequently used branch before the
if block, without having to guess.
This was inexact and confusing at best. It looked like a mashup of many things confused in ways so strange I can only be thankful it's not what the course is about. Students interrupted him a few times, asking rhetorically if he was talking about Java or OO in general (he agreed that he should have been more explicit about the distinction between the two, but still told several inaccuracies), but we remained silent while he went on with his explanations on branch prediction.
So. How do you tell your professor he's not on the right track? Obviously, doing it in front of everybody is not a Good Thing™. But waiting the end of the class to tell him might do some serious damage to the understanding of other students.
I suspect we won't hear this kind of stuff again, and the rest of what he told us did make sense, so filing a complaint is certainly not an option (especially after just one class). He seems to be in position of teaching design patterns, but he really went off-road with his talk about compilers and that stuff.