Reprinted from: http://blog.cnbang.net/tech/1813/
Unknowingly do iOS client development has been more than half a year, understand the iOS client development and Web front-end development of some similarities and differences, write about.
- Version upgrade. From a user perspective, the client upgrade must have the user manually download the entire new installation package to overwrite the installation, and the Web upgrade requires no user to do anything. Development point of view, if the client has a small bug needs urgent repair, need to complete the repair after the package of a completed installation package, to a version number, released to the user upgrade. The web only needs to modify some files in the background, and then upload to their own server, with much faster iterative development method is no problem. There is no version compatibility problem with the Web, and the client is a big problem.
- The iOS client uses the compiled language, the Web script language. Compiler language Benefits: Many errors compile the time to know, do not worry about writing a wrong letter caused by the problem. iOS client development is only available with Xcode and cannot choose the editor you like. The Web with scripting languages is free to select the editor regardless of the front end.
- The client crashes as soon as it encounters an exception, the Web one try catch can catch all errors, the user can continue to use other unaffected features, even if all the features are affected, refresh the page to get everything done. The interface and programs on the web are really separated, and the client is glued together.
- Find HTML+CSS style layout automatic arrangement is quite advanced, everything on the client depends on the program to specify the size of the position and the changes in the arrangement, visual xib is very chicken.
- The single thread of the web is very happy, the client to handle multi-threading, although powerful, but very cumbersome. The web has almost no memory leaks to consider, and the client needs. Client development can use a very low level of interface and functionality. The web is in the upper level, under the browser package, the advantage is that many problems the browser handles the web without a tube, the disadvantage is limited functionality.
- Web and client development almost all use MVC-like patterns, and data is updated through the controller to individual views. Web multi-use Callback,ios multi-use delegate, although iOS can also use block as a callback, but still not JS convenient, may also lead to some memory problems.
In general, from the development of general applications, even if you do not talk about cross-platform, web development is also a lot of benefits, but this is only a development perspective, in fact, mobile device webapp condition is always bad, and the original client is very large, the reason:
- Network does not, traffic to money. Domestic network environment We understand, although HTML5 have manifest,storage these means cache webapp, but give people feel is not reliable, open it or open a Web page the same feeling: consumption of traffic, and may not open in the case of network bad, There is no sureness like the native app that has been downloaded down.
- Animation/experience. General web in the page to switch between or show hide a component is no animation, we are accustomed to, the iphone with a head, everything to animation transition, resulting in mobile devices everyone accustomed to the animation switch, can not stand the application of no animation, The webapp that led to animation performance is far less experienced than native clients.
- Add WebApp through Safari to the home screen such habits are very not popular, very few people know, but this should not be a problem, if there is no above two big problems, this habit is easy to popularize.
P.S in the development of general applications (data processing/interaction), the web has a great advantage, after the network and performance problems resolved should be the preferred development method. But in the game field I do not see any advantage of the web, continue to be a bit hot HTML5 game Development express puzzled.
iOS client development and Web front-end development