It seems that code-shares are extremely common nowadays, with any flight on a non-budget airline having at least one. However I could never understand why airlines bother with code shares in the first place. I'm pretty sure they can sell connecting tickets on partner airlines without a code-share and having several codes creates some confusion when trying to find your flight at the airport.
So what's the rationale for having a code-share agreement in the first place?