Why I embrace Bitcode
Last week I was enabling Bitcode for the PostNL app we develop. Bitcode is a new technology from Apple that optimizes your app by recompiling it in the cloud with optimizations for the specific device that downloads it, making the app smaller and faster on the user’s device. Later that week I stumbled upon the blogpost “To Bitcode, or Not to Bitcode?” by David Wheeler.
His recommendation on Bitcode is to “wait and see”, because of potential security issues and the possibility of irreproducible bugs. Of course some of us are forced to use libraries that don’t support Bitcode and some of us want to write inline assembly, so those could be valid arguments to temporarily disable Bitcode. All his other arguments do not impress me very much and I believe they shouldn’t scare you either.
Take for example the fear of hackers injecting code into your app. You already submit your apps to Apple. If hackers are so deeply embedded in Apple’s infrastructure that they can control the (re)compilation process, they will have so many other ways of modifying or getting your apps’ data that disabling Bitcode really won’t matter. Besides, I would be more worried of your own developers having malware on their computers, like modified Xcode versions, than Apple being hacked at this level.
Irreproducible bugs due to extra optimizations would be Apple’s own worst nightmare. It would be very bad for customer satisfaction. So you can bet Apple is going to great lengths to prevent apps from crashing. Most code iOS developers write is not so low level that compiler optimizations would affect it in a way that makes it crash. If you write code that stops working when you change compiler optimizations, you’re either doing it wrong or you have found a serious compiler bug. If you happen to be that one person to run into that very specific issue, you can always disable Bitcode as a workaround and report the issue to Apple.
I believe new technologies like Bitcode help us move forward. Bitcode helps us worry less about the small things and gives us more time to develop stunning user experiences. We shouldn’t “wait and see” how things play out, but embrace change and explore how it makes our apps better.
This also touches on a broader point. I think developers should help the business they work for move forward. Develop for the future and where the technology will be going, not for the past. Apple is committed to technologies like Swift and Bitcode. They make them available to us so we can make better apps for our users and will continue to improve them. Embrace change, make your apps even better than they already are and don’t fear Bitcode or any other technology that makes your app better for your users.