My time at Lyons Davidson Solicitors as a C# Developer provided an early career lesson in the impact of applying SOLID principles to legacy codebases. I inherited a diverse technology stack spanning VB6, Silverlight, WPF, and ASP.NET MVC - each with its own patterns and varying levels of code quality.
The most significant issue I identified was pervasive code duplication. Database access code was copy-pasted throughout the codebase - each property retrieval required 6-8 lines of repeated code, with hardcoded string references to property names and individual database connections opened for every single query. For a single task, there could be 10 or more of these interactions scattered across the codebase.
I built a reflection-based database access framework from scratch that centralised this logic. The framework used dictionary-like access to property values, establishing a context on entry and allowing properties to be accessed via generated const strings, essentially using nameof(), under the hood. This reduced typical database interactions from 5-8 lines to a single line of code. In one particular library, applying this framework alongside repository patterns reduced class sizes from an average of 4,000 lines to 400 lines - a 90% reduction.
I also identified duplicated authorisation logic across the Silverlight component ecosystem and began developing shared packages to centralise these concerns. This early experience with framework development and SOLID principles shaped my approach to code quality in every engagement since. The lesson I took forward: clean code practices deliver measurable, demonstrable results.