News for hackers. Stuff that matters.
Re:Linus vs C++, again by j_baker on Thursday June 10, 2010 @05:02PM (#1421670)
Yes, that is context-sensitive, but it's pretty tame. First of all, if I look at that, I can tell it's probably a pointer. After all, it doesn't make much sense to multiply two variables and then not do anything with the result, does it?

On the other hand, it can mean a variety of things in C++. Are we multiplying numbers? Is foo or bar an instance of a class that has the * operator overridden? Is there a global overload of the * operator? Are we declaring a pointer?

Re:Linus vs C++, again by kenjackson on Thursday June 10, 2010 @05:44PM (#1421845)
But in a well-written program the use of overrides would make sense. Just as much as this function: ExitProgram(); should be clear in the context of a program. Now it's possible that this function actually creates a new process that then plays tic-tac-toe. But in a decent program, it will do its best to be consistent with what you expect. Likewise, if I see A * B, I expect that we're multiplying A and B. What does multiplication mean? Depends on the application, but I expect it to make sense.

And with a decent IDE you should easily be able to get the def for the '*', just like you'd get the def for any other function.

The problem isn't in the C++ language, but rather the C expectation that many developers have.