Let me begin by highlighting couple of roles of a Scrum Master as quoted by the Scrum Alliance:
The ScrumMaster also works with the development team to find and implement the technical practices needed to get to Done at the end of each sprint.
Another responsibility of the ScrumMaster as quoted there include removing impediments to the team’s progress. These impediments may be external to the team (such as a lack of support from another team) or internal (such as the product owner not knowing how to properly prepare the product backlog). That said, the ScrumMaster fosters self-organization, meaning that the team itself should remove issues wherever possible.
Some other responsibilities mentioned include helping a PO creating and maintaining Product Backlogs, facilitating meetings, and making sure Scrum process is strictly followed.
I work in an Agile environment with 6 Scrum teams, as a developer in one of the teams. We follow Scrum professionally and as expected, the scrum master chases developers to get all user stories finished by the end of the sprint, as we commit the delivery right during sprint planning (without really touching on the technical aspects). Now obviously, the scrum master is not expected to know anything about code or how time consuming/difficult a user story is; all he wants is the user stories finished.
Now let's consider what Robert Martin has to say in his book Clean Code:
Most managers want good code, even when they are obsessing about the schedule. They may defend the schedule and requirements with passion, but that's their job, It's your job to defend the code with equal passion.
Alright, so here goes my descriptive question: We all know writing clean and maintainable code could be time consuming depending on the task (for example architectural work usually require lots of time and efforts). Now, if writing clean code and maintaining them is an important aspect in software development, why does Scrum assign Scrum Masters (who don't have any programming knowledge) the role of getting developers to quickly achieve 'Definition of Done' before the end of sprint? A lot of times due to this, most developers end up not bothering much about writing reusable quality code and just write a slew of code just so that the feature is implemented. Rather than protecting developers from impediments, wouldn't it be appropriate to conclude that a scrum master is an impediment towards writing clean code?
Now someone could argue saying that scrum masters are supposed to do this so that the developers stick to their commitments and get the features delivered. But I think we have already touched on the point that scrum masters basically foster self-organization, and that the team itself should remove issues wherever possible. Its quite obvious that if the team doesn't deliver the features as committed, then they shall ultimately bear the brunt from the higher management, the thought of which should automatically drive the developers to work towards their commitments whilst not hindering them from writing good code.
My point is not against having scrum masters, I definitely agree with all other responsibilities of a Scrum Master other than racing developers to get the tasks done.
Am I justified in expecting the Scrum Master to allow me needed time to write reusable code?