Before you whip out your snarky comments, I know -- this is a nooby question. This is my first time using a C based language.
I'm an undergrad student learning Objective C for a computer science course on mobile development. I know that, in an academic setting, a lot of real-world considerations aren't necessary since you're building smaller projects, work in smaller teams, etc.
But our professor demands -- and XCode supports -- .h header files for every .m implementation file. To me, it kind of seems like busy work. I have to make sure I copy every method signature and instance variable over to the other file. If I change one file, I have to make sure it's consistent with the other file. It seems like just a bunch of small annoyances like that.
But I know there has to be some real-world use for header files. A great answer would address both:
- What is a header file useful for that an implementation file isn't suited for? What is its purpose?
- Why do we as programmers have to manually write our header files? It seems like they could easily be generated automatically.
Thanks in advance!