DEV Community

Manuele J Sarfatti
Manuele J Sarfatti

Posted on

Never write for only one platform thinking you'll adapt your code later

Most of the times this happens in the form of "this magical service only works in Chrome as of right now" or "I'll start with the desktop version and once it's perfect I'll add mobile" and all things in between.

Just, please stop. Here's why.

1. Chances are you'll never actually tackle other platforms

There will always be one last bug, one last feature, one last optimisation. Once your service is running are you going to prioritize a new feature requested by a couple of paying customers or are you going to stop all development to add a second platform?

I wish I had kept note of all the services that I wish I could have used but were "temporarily concentrating on the best experience for Chrome users, with other browsers on our future roadmap". "Temporarily" as in "checked back over a year later and still nothing".

I probably haven't because the tool to collect such things didn't work on my device or browser of choice.

2. Even if you do, it will never be as curated as the first platform you developed for

This is just how our brains work. Product fatigue is real, production delays too.

Imagine you spend 6 weeks perfecting the desktop experience of your website, and you are obviously two weeks late on the schedule at this point, plus your PM is a pain in distress (and consider yourself lucky they are the one facing the client).

How do you think the mobile version will come out? Yeah, not pretty probably... And surely you'll never have the time or even the mental energy to fix the experience in that hybrid monster which is a vertical iPad.

3. Even if it is, you'll have spent twice the time than if you had started right away

Yes, developing for multiple platforms from the get go means starting out at a slower pace. But it forces you to separate logic and side effects, abstracting away the core while leaving flexibility on the implementation.

Imagine developing for desktop only, at first, and basing the entire experience on the assumption that a mouse cursor is present. Possibly embedding this assumption deep in your app core. I don't know you but I would not want to have to take the whole codebase apart to make it work with taps and swipes.

And remember no. 2, at that point you are literally having code nightmares. Sleepless nights that just add to the overall stress and fatigue.

4. You are actively turning away 30-to-50% of possible users

And especially me, because I have a Mac, but an Android phone. And I prefer Firefox over Chrome (for no particular reason, but I'm not changing browser only because you are too lazy to code for all, I'll just go with your smarter competitor even if its product is slightly worse).

Yes this is all a personal rant.

But it's also a sort of code of conduct I vow to adhere to from now on, as I've broken these rules many times over.

These points are all valid.

Also, screen reader test your work from the very start. Seriously.

And happy coding! ๐Ÿฆ„

Top comments (0)