There's a lot of disagreement when it comes to merging the developer and the scrum master role, and the main question is "How is that scenario beneficial for the final product?".
I am part of a three member team, which consists of two developers, one scrum master and one product owner. Yes, you've read it right - three individuals, four jobs. My team works on a project where we have that scenario. One person (in this case I) is both a developer and a scrum master.
We've been using Scrum since the beginning of our project, and our senior developer played the role of SM for a while. As we got to know each other better, got familiar with agile and the project itself, our senior developer was promoted to product owner. So it became natural for another team member to take the role of scrum master.
As I was part of the project from the very beginning, and our third colleague was fresh on the team, I became the new scrum master. I took some courses on a very short notice, expanded my knowledge of the scrum master role, and started a new phase in my career.
As time went by, through dealing with both roles, I had some positive and some less positive experiences. Here are the pros and cons, from my point of view:
There were some downsides for me, during the process of juggling both roles at the same time. I would mention just one, because I think it's the only one that applies to everyone; others vary from person to person.
Pros and cons included, the benefits of being a developer and a scrum master as well, depend on several facts:
I think a smaller, already organized team, of 2-3 members, can have better results with merging the roles of developer and scrum master. It is easier for that person to contribute as a developer, as well as scrum master. This way, the pros outweigh the cons.