3 ms·
Oh yes, some years ago I got the opportunity to migrate a vb.net into c#. The average reader might think "it's the dotnet eco system, so what" but please read o
by SeriousM 4y ago
Oh yes, some years ago I got the opportunity to migrate a vb.net into c#.
The average reader might think "it's the dotnet eco system, so what" but please read on.
The code was maintained by a single guy over the last 10 years for a niche market. Spanning from winform code over silverlight, asp.net and background workers, having the business code right below the buttons, with no sense for coding styles.
They didn't share a common codebase yet "some" parts were kind of the same (copied over at some point in time) but evolved into different directions.
The first thing I did was searching for a way to convert the vb.net code into c#.
90% of this huge codebase was converted to compiling code, 10% was handmade.
Now with a compiling code I started forming a shared base, introduce abstractions to support the different derivates of services, introduce dependency injection (> 70% was static code), introduce unit testing, introduce command pattern to share business code throughout the code.
Over the span of two years we migrated bit by bit to the new architecture while running our business.
Starting with framework 4.6 and single server hosted services we're now on dotnet 6 and kubernetes in azure and deploy with azure devops pipelinee.
The benefits of this migration are so huge, we're now able to deliver features and fixes in a reasonable time and we can sleep well.
Always remember: Legacy code is legendary code because it pays your bills. Honor it and you'll be fine.