3 ms·
tl;dr: If you can, go native all the way, but if it makes a lot of sense from biz perspective to support platforms other than iOS, HTML5 is not as bad as it see
by radex 13y ago
tl;dr: If you can, go native all the way, but if it makes a lot of sense from biz perspective to support platforms other than iOS, HTML5 is not as bad as it seems.
I recently made an app for http://productivemag.com http://productivemag.com (for iOS and soon Android) using web tech, but I also have experience in native iOS/OSX dev. I use Cordova as a wrapper around HTML5.
My conclusions:
- HTML5 is great for custom UI and prototyping. You can do that right in your browser, no compilation needed. And Web Inspector is _awesome_. Experimenting with UI in ObjC (or Photoshop, IMO) is PITA, but Web Inspector makes it super nice and easy.
- Native is great for using native UI. I had to recreate not just the appearance, but the behavior of a lot of elements. It takes a lot of time to get right.
- I don't know about Java and Android, but ObjC is a poor language. I used CoffeeScript for the project and it was a far superior experience.
- Debugging JavaScript on Android sucks
- Debugging JS on iOS is pretty good, but it's still more painful than using Xcode's debugger. OTOH, JS is harder to _really_ break. If there's an error, _something_ won't work, but the app won't crash. Not always true with ObjC.
- interfacing with native capabilities is hard. iOS's WebView doesn't expose direct access to the JavaScript VM, so the bridge between two worlds is based on callbacks. Async is much uglier and more error-prone.
- Cordova sucks balls
- you can get pretty damn close with how fast and smooth the app works with CSS&JS, but you can never quite get there. Lots of little bugs and quirks, which are hard to fix.
- it sucks not to have control over how things are rendered. You can make wonders with `-webkit-transform: translate3d(0,0,0);`, but it's not perfect.
- aferreira 13y agoWould just like to add to this answer that, as of Android 4.4, the WebView is based off of Chromium, enabling you to perform remote debugging with your chrome web developer tools (basically everything you can do on a website you can now do on a WebView). I'd still pick native any day. Control > ease.
- radex 13y agoThat's true, but sometimes things work just fine 4.4 and only break on the undebuggable Jelly Bean or older ;)