Readable, consistently-formatted code
Published 29 October 2019
- More efficient code reviews – it is much easier for any team member to review another's code with minimal confusion and edit code without introducing inconsistencies and errors.
- Faster troubleshooting of T-SQL scripts – it is much easier to compare two different versions of the same script, or block of code, and work out what change caused a problem.
- Smoother joint development efforts – a common standard will facilitate handing off code to other teams, such as operations, for security, compliance and performance review
Consistent formatting makes code easy to read, understand and share. SQL Prompt's formatting styles make it easy to define and implement a standard SQL style across your development team, while still affording each developer the flexibility of applying different styles, locally, for different uses. This both reduces time spent styling code and makes code much easier to share and review among the team.
Developers want their code laid out to a style that is natural for them to read and understand. If done manually, this means time spent changing the case of object names, hitting the return key to insert line breaks, then banging the space bar to get all the clauses lined up, before the real work even starts. When they commit code to source control, it will inevitably be formatted in their bespoke style, so another developer reviewing it will go through this process again.
SQL Prompt reduces code formatting time to an absolute minimum. On their local workstation, a developer can apply a personalized formatting style for developing code, perhaps a different style to make comparing code easier, and so on. Having defined their styles, switching between them is fast and easy; a couple of mouse clicks will set the required style as the Active Style, then a few keyboard strokes (Ctrl K, Ctrl Y) will apply it to all code, or selected code, within an SSMS query window.
When a developer is ready to commit the code to version control or needs to ask another team member to review the code, simply select and apply the "team standard" style first, to ensure that the team always gets to review consistently formatted code. The shared team style is treated like any other asset of the development project. It is stored in version control, and everyone in the team can access the latest version.