Halo sahabat selamat datang di website rambutpantene.uno, pada kesempatan hari ini kita akan membahas seputar Ask an Engineer: Is It Ever Time for a Code Rewrite? oleh - rambutpantene.uno, kami sudah mempersiapkan artikel tersebut dengan informatif dan akurat, silahkan membaca
Itâs been blamed for the downfall of companies from Borland to Netscape. Serial entrepreneur Steve Blank calls it âstartup suicide.â Stack Overflow CEO Joel Spolsky claims itâs the âsingle worst strategic mistake that a software company can make.â What is this killer mistake? Itâs the code rewrite, and it has a terrible reputation in the tech community.
To be sure, rewriting your app or websiteâs entire code base is a huge undertaking. However, there are definitely occasions when a code rewrite makes perfect sense. Maybe your existing code is written in an older, less flexible language that simply wonât do the things you need it to do today. If your app is small and just getting started, rewriting all its code from scratch might not be such a large overhaul.
Likewise, very large companies can sometimes absorb the costs of a rewrite without skipping a beat. Rumor has it that Amazon, Apple, and Foursquare have all, at one point or another, rewritten large chunks of their source code. If your company can survive the transition, it is definitely possible to gain huge cost savings over time by rewriting a system to be more efficient and to use fewer computing resources under the same load.
If your company is neither very large nor very small, though, how do you weigh the pros and cons of such a major change? Here are some tips, based on my own experience.
Tip #1: Beware of engineer bias
My company, Carousell, is a mobile classifieds marketplace with millions of unique users who access our app from hundreds of different devices. As with every fast-growing startup, one of our biggest challenges during our earlier years was our ongoing struggle with technical debt as we built and shipped new features for our users. The more changes we made to our mobile apps, the harder it was to develop new features on our backend API services. Our website and app started to run slower and slower. Pretty soon, the scuttlebutt in the engineering department had it that we needed to start over from scratch. We needed a code rewrite⦠or did we?
The ability to tinker with new technology is why I became a programmerâ"and a code rewrite is a tinkererâs dream. It is a big red reset button that sweeps away all past mistakes, and leaves you with a blank slate on which you can test new technologies. And therein lies the problem. Try as we might to be objective, engineers always have a vested interest in rewrites. The fact is, itâs much more fun to write new code than to read and debug code that already exists.
In my role as an engineering manager, however, I also had to think about the rewrite from a management perspective. Most developers (myself included) want to work with new technology, but if the technology is too new and untested, it can be buggy and unstableâ"which can lead to more user experience problems than itâs worth. New technology ultimately has to benefit users, not just interest my employees. Which brings me to my next tipâ¦
Tip #2: Be mindful of hidden time costs
In exchange for the freedom of rewriting our code, our company would have to give up the most important currency that startups have: time. As Wonolo CTO and Chief Data Scientist Jeremy Burton wrote in a great blog post on the subject, spending time on a code rewrite means spending time not updating your current code base, which could give your competitors time to pull ahead. A code base rewrite will also result in downtime while youâre testing new technology, which would be a worst possible case for users. Even worse, like any tech project, code rewrites can also end up taking much longer than expected, so any of these downsides can easily mushroom out of control.
Some of the time costs of rewrites are less obvious. For instance, many of the âfine hairsâ sprouting from your existing code are bug fixes; they may look messy, but they represent the results of years of testing and fine-tuning based on user feedback. If you rewrite your entire code base, youâll be starting this fine-tuning process over from scratch. (After all, no code baseâ"no matter how elegantly writtenâ"is 100% bug-free.) If youâre trying to estimate how long a code rewrite will take your engineers, include the time spent debugging as well as just writing new documentation. Your bottom line will thank you eventually.
For us, the dealbreaker ended up being downtime: we simply couldnât afford it. If our app didnât work consistently, our large user base would quickly flock to another, more reliable app. Instead of a code rewrite, we needed a middle-of-the-road solutionâ"and one that could be implemented with minimal testing.
Tip #3: Explore incremental alternatives
As we opted not to pursue a code rewrite, we decided to resolve our technical debt by moving towards microservicesâ"a modular and highly scalable approach to software development employed by companies from Netflix to Amazon. Instead of maintaining one monolithic code base, we would reorganize our code into smaller, independent modules that could be updated one at a time. This new architecture would allow us to support new features and resolve existing technical issues without rewriting the entire code base.
To support our plans to move towards microservices, we migrated our existing backend service to the software containerization tool, Docker. At three years old, Docker wasnât the newest, most exciting technology aroundâ"but it had been thoroughly tested by other companies, and most of its bugs identified and resolved. That meant we could deploy it with relatively little risk. (It also helped that it was open-source, and therefore free for us to access.)
After testing, we discovered we liked Docker combined with Kubernetes, an open source software designed to manage containers like the ones that Docker is based on. By putting Docker and Kubernetes together, we built a custom solution that now serves all of our production trafficâ"all with minimal downtime while preserving most of our existing code. This custom solution will enable us to incrementally upgrade parts of our codebase using microservices in the future, with no visible downtime or impact on users in the event of an unsuccessful rollout.
How do you decide?
Thereâs no one-size-fits-all solution to technical debt. If your business is established with a lot of legacy code, even our strategy of co-opting an open source solution might be too risky for you. For a smaller, less established startup, it might be too piecemeal. You have to decide what your companyâs priorities are, and then proceed from there. In our case, we decided to value minimal downtime for users over the excitement of rebuilding our software from scratch. Your case may very well be different.
In an ideal world, however, this weighing process doesnât become a push-and-pull between whatâs exciting for developers to work on and whatâs good for users. Instead, creating the best possible user experience becomes part of what makes the developerâs job intellectually stimulating. I know thatâs how it feels to me.
With contribution from Lauren Orsini of the Hippo Thinks research network.
This article first appeared in AlleyWatch on 6 March 2017. Â
Itulah tadi informasi dari poker online mengenai Ask an Engineer: Is It Ever Time for a Code Rewrite? oleh - rambutpantene.uno dan sekianlah artikel dari kami rambutpantene.uno, sampai jumpa di postingan berikutnya. selamat membaca.
Komentar
Posting Komentar