Updating software can be a pain. Maybe you can’t find a feature you depend on. Or maybe that feature is gone for good. Other software you use might not work with the new version. Or maybe the new version is just flat-out broken. And yet, with few exceptions, most of us stay on the technology update treadmill.
Usually it’s because the old version of the software is no longer supported, meaning it won’t receive security fixes and might not run on new operating systems. I addition, the new version includes features that make the pain of switching worthwhile. In the age of the app stores, the updates might happen automatically with no way for you to roll back to the old version.
Coders have to deal with their own version of this headache: updated versions of programming languages.
Those new versions typically add features, and may change a language’s syntax. In some cases, those changes make code written in old versions of the language incompatible with code written in the new language. Programmers then have to decide whether to start using the newer version, which often means rewriting old code.
Coders make the shift for the same reasons consumers and businesses adopt new versions of software: to access new features, as well as to maintain compatibility with modern hardware and common tools. But the updates can be more complex than installing a new version of Office or Quickbooks.
For users of the popular programming language Python, the issue is coming to a head next month. The developers who maintain Python, who work for a variety of organizations or simply volunteer their time, say they will stop supporting Python 2 on January 1, 2020—more than a decade after the introduction of Python 3 in December 2008. That means no more security fixes or other updates, at least for the official version of Python. The Python team extended the initial deadline in 2015, after it became apparent that developers needed more time to make the switch.
It’s hard to say how many organizations still haven’t made the transition. A survey of developers last year by programming toolmaker JetBrains found that 75 percent of respondents use Python 3, up from 53 percent the year before. But data scientist Vicki Boykis points out in an article for StackOverflow that about 40 percent of software packages downloaded from the Python code management system PyPI in September were written in Python 2.7. For many companies, the transition remains incomplete. Even Dropbox, which employed Python creator Guido van Rossum until his retirement last month, still has some Python 2 code to update.
Dropbox engineer Max Belanger says shifting the company’s core desktop application from Python 2 to Python 3 took three years. “It wasn’t a lot of absolute engineering work,” Belanger says. “But it took a long time because stability is so important. We wanted to make sure our users didn’t feel any effects of the transition.”
The transition from Python 2 to 3 is challenging in part because of the number and complexity of other tools that programmers use. Programmers often rely on open source bundles of code known as “libraries” that handle common tasks, such as connecting to databases or verifying passwords. These libraries spare developers from having to rewrite these features from scratch. But if you want to update your code from Python 2 to Python 3, you need to make sure all the libraries you use also have made the switch. “It isn’t all happening in isolation,” Belanger says. “Everyone has to do it.” Today, the 360 most popular Python packages are all Python 3-compatible, according to the site Python 3 Readiness. But even one obscure library that hasn’t updated can cause headaches.
Belanger says the upgrade was worth it because Python 3 is a better language than Python 2. For example, Python 3 offers new features designed to make it easier to write software that juggles multiple tasks at once. The new version also makes it easier to manage large code bases that many people work on, which is particularly useful for a company like Dropbox. “We have millions of lines of code and a large team,” he says. Taken together, Belanger adds, the features help Dropbox write complex software faster and with fewer bugs.
For a company with fewer resources, or for volunteers who maintain open source software in their free time, updating might have seemed like more trouble than it was worth. “I don’t think anyone says ‘I don’t want to update,'” says Jacqueline Kazil, a member of the Python Foundation board. “But maintenance like this takes time. And the people responsible for doing the update aren’t working on adding new features that are generally recognized as bringing new business revenue. But if you ignore ongoing maintenance, eventually it will cost you a lot more than the new features would have added.”
With the end of support for Python 2 looming, it will be harder for organizations to delay updating old code. More of the libraries that developers depend on are switching to Python 3. Code editing and translation tools will stop supporting, or at least deprioritize, Python 2. And just like any other aging software, older tools might not work well with newer operating systems and hardware. At Dropbox, the new features were a carrot, and possible obsolescence was the stick that motivated the desktop team to finish the move to Python 3.
Still, Kazil worries that some organizations and individuals might not realize the importance of updating to newer versions. For example, a researcher who uses several small Python programs for data collection and seldom changes the code might not realize that the code might one day stop working on newer computers—or could make them vulnerable to security bugs.
Meanwhile, the Python team is thinking about how to make the next big version of the language less painful to adopt. The Python team often releases small updates to the language—Python 3.7.4 arrived just a few months after Python 3.7.3, for example—but big changes like Python 3 have been relatively rare in the language’s three-decade existence. Python 2 was released in October 2000—eight years before Python 3. Lots of code was written during that time.
Kazil says the core Python team is now working to make smaller, more frequent updates. The idea is that it would take less work to migrate to new versions while still adding attractive new features. Van Rossum, who stepped down as the principal leader of Python last year but remains actively involved in the language’s development, wrote last month that there might not ever be a Python 4. The team could just add features to Python 3 indefinitely that don’t break backward compatibility.
Other language developers are taking a similar lesson from the Python 3 transition. Last year, Ian Lance Taylor, a member of the team behind Google’s programming language Go, published a proposal outlining the steps the team should take when introducing new Go features that aren’t backward compatible. “We will slowly transition to new language and library features,” Taylor wrote. “We could at any point during the transition decide that now we are Go 2, which might be good marketing. Or we could just skip it.”
Maybe app developers should take note too.
More Great WIRED Stories
- Meet the immigrants who took on Amazon
- Alien hunters need the far side of the moon to stay quiet
- The future of banking is … you’re broke
- How to shut up your gadgets at night so you can sleep
- The super-optimized dirt that helps keep racehorses safe
- 👁 A safer way to protect your data; plus, the latest news on AI
- 💻 Upgrade your work game with our Gear team’s favorite laptops, keyboards, typing alternatives, and noise-canceling headphones