Rewrite or...?
-
> but it's beginning to show its age That is a vague problem description. What is the real problem? - performance, - concurrency, - GUI (look & feel) - quality of code, - no people that know the technology? - ....
All of the above. People know the technology, they just don't want to work with it (including me, to be honest).
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Avoid doing a hard rewrite/relaunch, do a gentle "sunsetting" over time 1 Keep the old application but keep track of how many hits it gets 2 Make a new competing application, also tracking its hits Then launch them side-by-side, giving the user a choice about which one they want to use, maybe even having cross links to make them able to "jump to the other side". Keep a look at the statistics to see if the new one is gaining or losing. I think you get the basic idea. Suggested reading: https://medium.com/@herbcaudill/lessons-from-6-software-rewrite-stories-635e4c8f7c22[^]
It's an internal business application. No competing or statistics there, just the one or the other.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
You haven't given us any idea how big the system is (in terms of lines of code or whatever). Although, arguably, the bigger it is the more it would make sense to rewrite it rather than having to keep some old, creaking codebase working. I recently went through my entire C++ codebase replacing a lot of old-fashioned manual memory management with 'modern' C++ idioms. It was a daunting prospect initially but I am sooooooo glad I did it. So, I would say, if you can handle the issues that Sander (quite rightly) raises and have sufficient resources then I would go for it. Just my $0.02
Paul Sanders. If I had more time, I would have written a shorter letter - Blaise Pascal. Some of my best work is in the undo buffer.
Well, what do you expect after 20 years of development? It's not small, it has a few dozen pages with features such as entering sales orders, purchase orders, importing data from various sources, exporting to various sources, product and client management, stock management... Basically everything a mid-sized organization needs to do business.
Paul Sanders (the other one) wrote:
So, I would say, if you can handle the issues that Sander (quite rightly) raises and have sufficient resources then I would go for it.
If I can handle the issues I raised myself? :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
I've awoken my old account just to chime in on this as I've had some recent, terrible experience here that might help. I'll try to keep my rants to a minimum. Sadly my last position was working in this tech stack, with over 150 customers using various versions of the product. - Business logic strewn throughout SQL procs, UI and a little bit of mis-informed backend abstractions coupled with embedded and sitewide javascript. - No source control, at all :mad:. - Zero, or inadequate out of date documentation. - Team works on network shares. - Manual deployment. - No IDE or any other tooling (except for SQL Management studio). - Building was done using cmd scripts split into arbitrary "modules" due to the limitations of the command buffer string length. - Versioning on live system was mandated - rename the old file with a date, and leave it there. - Sometime in the past they switched from VB to C# which was the dominant language when I started. The mix led to some awful days where I realised I had to touch the VB, and those days were long, unproductive, usually doomed to fail. Staff turnover (all senior devs) was 100% for new hires, lasting from 4 months to 1.5 yrs (me, the fool). 10 years of constant losses, mostly negative customer relations with some "entrenched" customers buying out the parent company on more than 2 occasions to keep their critical systems from vaporising led to my current attitude to this type of product.. return to the ship and nuke it from orbit. Seriously though, I would park it in a vm(s), charge a fortune for anything that needs change management. "Try" to fix any security holes that are essential, but first try to mitigate those within your new virtual infrastructure if you can first. Product is not cost effective, and the customer needs to understand that through passing on that aspect of the business. If cost is not an issue, maybe think about selling it on to an outfit that doesn't mind/understand financial loss, the technical debt or the talent attrition it will cause :suss:. You mentioned updating the html/css and providing a more modern approach to responsivness. The product I worked with had all that already and still had the above issues. My opinion is that it will not improve your developers lives, nor maintenance timescales, but might reduce the front end developers attrition in the long run. It might also increase the appeal of the application to the customer, making it seem "better". Do you really want that? Moving to C# might seem like a good plan, b
Ouch, sounds painful. Seriously though, how old was that product, no IDE or tooling, how did they write it in the first place!? :wtf: No source control!? Were these even developers? Did they have any sort of training at all? :omg: The more I read this thread the more convinced I am doing a straight up rewrite is not the way to go.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
One very good and not-going-to-flip-the-canoe improvement might be Flyway. The learning curve to some very basic "make sure my database state is what I think it should be" is not at all steep, but there are also some nice to haves if you dig deeper. You essentially version control your DDL/DML into numbered scripts which it then facilitates applying to a given database by checking to see what was the most recent one applied and applying anything newer. A nifty option (that you have to also create if you want) are undo scripts correlated to the "do" scripts that allow you to rollback the change made by the "do". This marries into build/release pipelines in easy and good ways. For an Azure DevOps build pipe, you might first have a commandline step "clean my database and start over so nothing is funky from a previous mistake or someone mucking around because it is the build box". In both build and release ADO pipes it is another commandline step added to flyway migrate the db. You could deploy and run the flyway scripts and flyway infrastructure required to run them (a bunch of java) from the artifact project folders being deployed if you wanted to. Typically, we don't do that, opting instead to deploy and run the migrations from a totally different environment. We do this partially because there would be multiple service hosts in a deployment group and you only need migrations to run once. While it's not a huge bunch of more binaries/data to throw out there, on all but one machine it would generally exist for very little reason. "LINQ queries are a pain in VB!" I'd forgotten that particular horror, thanks.
Yeah, I know Flyway, actually already mention it with my client :D
jochance wrote:
I'd forgotten that particular horror, thanks.
You're welcome :D
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Scope...Scope Best practices, on web especially, tend to lean towards the concept that your site is going to be the next viral app. A low volume site will generally outlive the technology behind it. Having 5k users today doesn't mean you'll have 50 or 500k next year, or anytime in the future. So, I'd want to look at traffic, and make some decisions based on that. Really, I'd roll back the entire look to see if .Net is the best choice for what you're looking for. Since I'm about 67% desktop development, I've been tempted to try .Net on the web, but use LAPP/J-various on the web side of things. (And it's way cheaper and easier to maintain) That's just me though. We're re-writing 25yr old VB6 desktop code and it starts out as fun, but goes downhill from there. :) Not knowing how deep the site is, it's tough to make a really good call. Also, how deep are your customer's pockets? I think this might be a good start:
Quote:
Maybe we can start by modernizing the generated HTML and CSS to make things more modern, like making the pages responsive.
since in any case it's going to need to be done as part of any upgrade and won't be wasted effort. Your client may be more responsive to a multi-step approach. Been too many years since I've looked at SQL Server to comment on that part; heck, I don't even know what
Quote:
SQL queries written directly into the HTML
means, lol.
MikeCO10 wrote:
Been too many years since I've looked at SQL Server to comment on that part; heck, I don't even know what Quote:SQL queries written directly into the HTML means, lol.
Exactly what it says. Pseudo code (I don't know the exact syntax or commands from the top of my head):
...
...Visual Studio doesn't indent it (anymore?) though, so most of this is just hundreds of lines of randomly (un)indented HTML with SQL queries strewn about.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Am in a similar position, but with an app written only about 8 years ago; VB.Net, ASP.Net webforms - but well-structured, multi-layer code, all D/B access via SPs, minimal logic in the SPs. Just trying to find WebForms developers to support going forward is the hard bit. Plenty of people with Webforms experience, but none who want to use it! I have "cloned" the application for another customer, converting to C# along the way (using online tools to automate). A certain amount of manual review needed but on the whole that was the easy bit. Doing it page-by-page (depending on how your site is configured) may not be possible - mine's setup as a WebSite (not a web application) and I don't think you can mix languages in that environment. Probably best to start with a language swap before then tackling any changes / updates; otherwise you've just got more - and less "mature" code - to convert. Depending on current structure it might be worth rebuilding one layer at a time - i.e. building a "modern" DAL and moving the SQL well away from the presentation layer. Update the production system at each major milestone rather than leaving it to a big-bang replacement. As others have said, the biggest hurdle is probably convincing the business of the benefits of all this work. Might be worth identifying any known bug-bears for the users and ensuring those are addressed early on so they are invested in getting the new version implemented. Similarly not bothering with "improvements" that don't deliver value to the users - e.g. no point in responsive pages if all the users are in the office on 24" screens. Sure you've considered all this and more anyway! Good luck...
Telegraph marker posts ... nothing to do with IT Phasmid email discussion group ... also nothing to do with IT Beekeeping and honey site ... still nothing to do with IT
DerekT-P wrote:
As others have said, the biggest hurdle is probably convincing the business of the benefits of all this work.
The biggest hurdle by far is doing the actual work :laugh: There are already talks about a rewrite, but I'm not so sure if that's the way to go. Rebuilding a layer at a time... That's actually good advice. We need to get that SQL out of the HTML code and create a clear separation. That would make any future efforts a lot easier!
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Ouch, sounds painful. Seriously though, how old was that product, no IDE or tooling, how did they write it in the first place!? :wtf: No source control!? Were these even developers? Did they have any sort of training at all? :omg: The more I read this thread the more convinced I am doing a straight up rewrite is not the way to go.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Painful was an understatement. Initially I was under pressure to find a job quickly and this paid ok. Then I tried too hard to fix things, I should have quit an hour in... Reasons for where they got to imo .. Misled non technical management, a priority on marketing, political division along dev/design lines and an old guard with speed, but no control or experience on their side from the start leading to a protective attitude. Speed to deliver was the ONLY consideration when I was there. As a result there was no time to fix anything even when experienced devs like me tried to put pressure on. Of course every project was underestimated with the lack of documentation leading to scope creep, overruns and customer disatisfaction from project inception. Product would have been brand new around 2009, ASP web forms was old even then. Only 1 original dev left, and a contractor that seemed to get work intermittently but never actually work/talk with anyone in the team. The original founder was kept around as a consultant, lol... This guy interviewed me, with the other original dev, and one question they posed was a simple relational data model question. Then when I hit the actual code I found they had no foreign keys defined, only indexes. I raised this in a formal review down the line, and was given a 5/10 grade for my work lol I'm currently on the bench as a carer, not employed since Covid redundancy so I have too much time to mull over this stuff. The organisational problems are interesting, and help understand the "how the F..." but from your response I am sure you don't have to worry about this junk. The tech stack is old and knackered and, imo, not really the platform I would have used even back in the 90's. One note of caution - watch out for use of the "viewstate". Check any page in your browser with form controls (or not sometimes) and look for a massive utf8 encoded field(s). Depending on if this is a public website or not, and your customers level of security paranoia, you might want to look into getting an upgrade to a later version of the .net framework at a minimum (4.8) and ensure you turn on the relevant secure features (machine id and encryption I believe are the keywords there).
-
MikeCO10 wrote:
Been too many years since I've looked at SQL Server to comment on that part; heck, I don't even know what Quote:SQL queries written directly into the HTML means, lol.
Exactly what it says. Pseudo code (I don't know the exact syntax or commands from the top of my head):
...
...Visual Studio doesn't indent it (anymore?) though, so most of this is just hundreds of lines of randomly (un)indented HTML with SQL queries strewn about.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Ahh, I remember those now. :) I'm curious if you have an approach you are leaning towards to address your question? The more I thought about, the more I think it goes to a client choice question. It's one I've presented to clients several times over the years and have gone the rewrite route many times, including two current ones. Also depends on your time/desire to do a rewrite. You can limit it some by using waterfall approach, but that depends on the client. I have one now that goes beyond agile to a "let's roll with it" mentality, resulting in about 60% of code written with about 25% released. Probably wouldn't be the case on a web app. Though I have a few curves on my current one, those are understood to be at the end of the project.
-
Well, what do you expect after 20 years of development? It's not small, it has a few dozen pages with features such as entering sales orders, purchase orders, importing data from various sources, exporting to various sources, product and client management, stock management... Basically everything a mid-sized organization needs to do business.
Paul Sanders (the other one) wrote:
So, I would say, if you can handle the issues that Sander (quite rightly) raises and have sufficient resources then I would go for it.
If I can handle the issues I raised myself? :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Oh, it was you that started the thread, lol. Sorry, need coffee.
Paul Sanders. If I had more time, I would have written a shorter letter - Blaise Pascal. Some of my best work is in the undo buffer.
-
Ahh, I remember those now. :) I'm curious if you have an approach you are leaning towards to address your question? The more I thought about, the more I think it goes to a client choice question. It's one I've presented to clients several times over the years and have gone the rewrite route many times, including two current ones. Also depends on your time/desire to do a rewrite. You can limit it some by using waterfall approach, but that depends on the client. I have one now that goes beyond agile to a "let's roll with it" mentality, resulting in about 60% of code written with about 25% released. Probably wouldn't be the case on a web app. Though I have a few curves on my current one, those are understood to be at the end of the project.
I think our problem now is that we simply don't have the capacity to rebuild while also keep developing what we have. Also, there are probably two people who know what does what and where to find it. One is a user that uses or used everything in the last twenty years, the other is a developer who built most of it or was somehow involved. It's in their heads though, so it should get out first. So I'm leaning towards a "let's refactor the hell out of this thing first when we touch something" approach.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
So I have this customer who has this 20 year old web application. It works, it's still actively developed, but it's beginning to show its age (well, I guess it's been doing that for years). It's VB.NET Web Forms updated to the latest .NET Framework, 4.8. It's pretty much what you'd expect of something like that. SQL queries written directly into the HTML (or whatever you call the Web Forms HTML), a lot of roundtrips to the server, and XML web services. Most logic is written in SQL Server views, functions and stored procedures, which don't really have any sort of reliable source control. A lot of programmers wouldn't touch it with a stick. Now there have been discussions over whether or not we should do a rewrite, or in any other way update to something more modern. Maybe we can start by modernizing the generated HTML and CSS to make things more modern, like making the pages responsive. Replacing VB with C# would be a good move to attract developers in the future and to make use of newer language and VS features and we can hopefully do that page by page (for example, LINQ queries are a pain in VB!). Perhaps throw in some build and release pipelines (it's now copy/paste) and replace SVN with Git. I know rewrites are hard, expensive, and probably more often than not don't end well. Have you been in this situation? What did you do? Tips?
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
I've been there many times as it seems I am one of those (un)lucky ones that actually enjoys untangling legacy code messes mysteries. What I usually do, after getting the hang of how to do a release with the current process, is: 1) Automating CI/CD - some things will be broken by refactorings, better be able to build/test/release quickly. Moreover, nowadays Git is a must; 2) Encapsulating all data access queries. Start with the writes, there are less of them and most of the time they can easily be ported to a proper data layer. Bonus points if you can start using a framework like EF6 that still runs on .net Framework - this may mean porting the SPs to code, but as you already mentioned that doubles as "putting them in source control". 3) Try to find the "bundles" of DB reads/writes and pack them into meaningful methods. This will be your business layer. May need to use TransactionScope to build some simple "unit of work" pattern here. Unless you need to use multiple databases this won't require using DTC so no major architectural problems here. 4) When all previous steps are completed, you have a UI shell around a business layer. That will need to be rewritten using your favorite technology. That's going to be less boring :)
Luca The Price of Freedom is Eternal Vigilance. -- Wing Commander IV En Það Besta Sem Guð Hefur Skapað, Er Nýr Dagur. (But the best thing God has created, is a New Day.) -- Sigur Ròs - Viðrar vel til loftárása
-
So I have this customer who has this 20 year old web application. It works, it's still actively developed, but it's beginning to show its age (well, I guess it's been doing that for years). It's VB.NET Web Forms updated to the latest .NET Framework, 4.8. It's pretty much what you'd expect of something like that. SQL queries written directly into the HTML (or whatever you call the Web Forms HTML), a lot of roundtrips to the server, and XML web services. Most logic is written in SQL Server views, functions and stored procedures, which don't really have any sort of reliable source control. A lot of programmers wouldn't touch it with a stick. Now there have been discussions over whether or not we should do a rewrite, or in any other way update to something more modern. Maybe we can start by modernizing the generated HTML and CSS to make things more modern, like making the pages responsive. Replacing VB with C# would be a good move to attract developers in the future and to make use of newer language and VS features and we can hopefully do that page by page (for example, LINQ queries are a pain in VB!). Perhaps throw in some build and release pipelines (it's now copy/paste) and replace SVN with Git. I know rewrites are hard, expensive, and probably more often than not don't end well. Have you been in this situation? What did you do? Tips?
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
I don't think you will find a "silver-bullet-answer". It depends on the application, but mostly it depends on how well will the business that uses the app handle missed implementations. Old apps like that have the habit of getting small hidden gems that we gloss over during rewrite for one reason or another. Then we realize... "Ohhh so that is what that code was for!" If the application allows, i'm partial to the use of [^] If done right, both can coexist, and you can port an old piece into the new code bit by bit. The way it works is, you make a request for a url, if that URL is routed on the new app thats what gets served, if that url is not routed on the new one, YARP will fetch from the old and serve.
-
So I have this customer who has this 20 year old web application. It works, it's still actively developed, but it's beginning to show its age (well, I guess it's been doing that for years). It's VB.NET Web Forms updated to the latest .NET Framework, 4.8. It's pretty much what you'd expect of something like that. SQL queries written directly into the HTML (or whatever you call the Web Forms HTML), a lot of roundtrips to the server, and XML web services. Most logic is written in SQL Server views, functions and stored procedures, which don't really have any sort of reliable source control. A lot of programmers wouldn't touch it with a stick. Now there have been discussions over whether or not we should do a rewrite, or in any other way update to something more modern. Maybe we can start by modernizing the generated HTML and CSS to make things more modern, like making the pages responsive. Replacing VB with C# would be a good move to attract developers in the future and to make use of newer language and VS features and we can hopefully do that page by page (for example, LINQ queries are a pain in VB!). Perhaps throw in some build and release pipelines (it's now copy/paste) and replace SVN with Git. I know rewrites are hard, expensive, and probably more often than not don't end well. Have you been in this situation? What did you do? Tips?
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
I'm going to assume there is a stable user base using the existing application, and although it's tempting to redesign from scratch, it can impact existing users negatively. so keep the existing product in maintenance mode, start a sub team or at least one person to start mapping functionality and building it in a newer .NET 6 using something like server side blazer; it will be a close relative to Web forms to migrate logic over. next step would be to modernize the layouts, if not already there. it's a slow process. my reasoning for this is you can launch the new version and have (almost) no difference to the "feel" of the application. once you know that the new platform is stable and works identical or better than the original version now you can start implementing newer layouts, letting the users grow with your changes. worse case when testing out the new version would be slipping the old one back in place if something major needs fixed.
-
Yeah, but unless you have a very solid plan and strategy that's destined to fail. You don't just rewrite 20 years of development.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
After clearing that up, we can investigate the query in more detail. To do that, I'll first briefly discuss a piece I penned that was moderately well-read. (and slightly controversial). That article was titled "The Myth of the Software Rewrite" by me.
I presented a fairly specific thesis in this article. I argued that businesses shouldn't rewrite their software because the developers amassed too much technical debt to do so successfully.