
Ask HN: How do you switch frameworks when you have a large codebase? - benjaminjosephw
I recently got a job at a company that has a very large Angular codebase. The company has a great engineering team and is trying to work on improving the design and structure of the code. The general opinion seems to be that Angular isn&#x27;t ideal for how we want to work but we&#x27;re so invested in it at this point that any move away would be painful and could be very costly. Stopping progress for a full-scale re-write would never be an option but I&#x27;m struggling to see how we can make gradual changes.<p>Has anyone had any experiences of transitioning a large clientside application to use a significantly different framework or design? How did you handle it?
======
beat
The best line of code is one that doesn't get written.

The first question you need to ask is _How important is this, really?_ It's
not a matter of whether Angular is "ideal", but whether Angular is
_tolerable_. Is Angular actually _preventing_ the team from implementing new
features? Is it the primary source (or a primary source) of bugs? Do you have
to do complicated workarounds to get real work done within the Angular
framework?

 _What problem are you trying to solve?_

Keep in mind that every line of code you write that doesn't directly increase
the value of the company is an opportunity cost. The man-months of work
involved in switching frameworks are man-months that aren't being spent
creating new features or new products, that aren't fixing known bugs, etc.
Moreover, it introduces risk - what if the engineering effort fails to produce
something that a: works, and b: is substantially better than the existing
Angular code?

If it is truly important, if it's really limiting the company's bottom line or
the stability of the engineering team (which is just another way of saying
bottom line), then talk about how to get from A to B. But first, decide just
how important this really is.

------
imaginenore
Start writing new features with the new framework. Rewrite the most used parts
of the old one, as much as you can.

You will end up with a codebase with two frameworks. It's not the end of the
world.

When we faced this issue, we did a complete rewrite. It actually reduced the
amount of code and made everything nicer, legacy code is often full of hacks
and undocumented nonsense.

