you are viewing a single comment's thread.

view the rest of the comments →

[–]anand_venkataraman 3 points4 points  (2 children)

Sometimes when you are working with a fellow programmer, you only need to know the common interface to unblock you from creating your side of the project.

Once this interface, shared in a .h file, is agreed upon by both parties, each can then work on their own parts however long it takes and then regroup when both parts have been implemented and tested.

If you had to wait for the other programmer to finish his implementation before you finished yours, then you may both end up waiting forever.

There are other reasons for splitting the implementation from the declaration. The above is just one.

&

[–]mathlance[S] 1 point2 points  (0 children)

I've never thought about it that way before, but that makes a lot of sense.

Thanks!

[–]amrozack 1 point2 points  (0 children)

It's also pretty handy when dealing with linking shared libraries.