alexcurylo wrote:
First off, tell the teacher he's being a twit since .h files work just fine
I wouldn't recommend that. My advice is go with the flow and don't raise a stink. The original poster could learn quite a bit from this class. I had one professor who was very close to being insane and wanted everyone to program everything in assembly. I can learn Objective-C, XSL, etc. on my own, but having those formative years in assembly were very helpful.
it's only the most anal of annoying twits like the STLplus clowns who insist on inventing some distinction between implementation and definition of templates for no particularly useful reason in the world and to the immense inconvenience of people who actually use production tools none of which have a clue what on earth "tpp" might be, as you've seen in this thread already.
I wouldn't disagree with that. I had never heard of STLplus either until this thread. If you are working in C++ and working with templates, it would be far better to embrace them and learn how they work than fear them and hide them in a TPP file.
Second off, drop your C++ class
Again, I disagree. The original poster could still learn C++ just fine in this class. We don't know all the details.
take up Objective-C so you can use a dynamic language where stupid compiler tricks like templates aren't necessary in the first place. Seriously. A handful of Cocoa projects later, you're going to be looking at your old C++ projects thinking "Why the @(#$&@&#!! did it ever make sense to have to write this kind of stupid @#($&@#$&!!!"
... but I don't disagree with this. I spent many years mastering C++, then starting doing a lot of Perl and Objective-C. I certainly learned an awful lot about programming by learning C, C++, and templates and that experience is invaluable. However, I don't expect I will ever code in C++ again.
Okay, moving on to immediately practical recommendations now, what you should do is select your project target in the inspector, go to the 'Rules' tab and add a new rule for .tpp -- and contrary to Eric's instructions above, make it "sourcecode.cpp.h" not "sourcecode.cpp.cpp".
Yes. A very good idea. You don't want Xcode trying to compile these files. Xcode can include any file with any extension. All you want to get out of it is syntax hi-lighting.
I'd kinda tend to agree with etresoft that you ought to look for another teacher though. Somebody who teaches you this kind of theoretically elegant but utterly out of touch with actual practice nonsense is not whom I would look for in a C++ teacher.
I doubt there is any "theoretical elegance" involved. The STLplus people may think that, but we have no idea what is going through the head of this guy. If you have the option of other teachers, go for it. If not, stick it out, and learn C++ on your own. There are plenty of resources to help with that.
As for the class, render unto Caesar that which is Caesar's. Sadly, you can't always (or even often) avoid bad teachers. Just try to make the best out of it that you can.