HTML5 notes (3)-HTML5 status quo

Source: Internet
Author: User

 

When every new technology is just presented to people, people are always used to considering what they can do from the perspective of technical characteristics (rather than user needs. People will use it to rewrite existing applications or implement functions that other technologies can achieve. This is a necessary exploration and accumulation phase. Some technologies will flourish after this stage, and some others are like getting a new hammer and hitting it everywhere. The results show that it is still a hammer, rather than disappointment.

 

1. Demo

 

There are already many demo and tutorial websites for HTML5, as well as many open-source projects based on html5. even The New York Times has HTML5: http://www.nytimes.com/skimmer /.

 

At the earliest I went to http://html5demos.com/this site to see HTML5's new features, while watching and guessing, and then against W3C specifications. Http://diveintohtml5.org/is a layout design very interesting website, if you have some concise and rigorous descriptions of W3C doubt, here may find a satisfactory explanation. In addition, w3school and other countless tutorial websites provide a large number of examples.

 

I also played some web games written in HTML5, including those running on desktop computers and mobile phones, and some eye-catching HTML5 designs (such as webpage templates and controls ), on the one hand, I was surprised by the strength of html5. on the other hand, I am also confused: Is that all? What else? Perhaps it is because I have not seen a killer HTML5 application, similar to the appearance of the iPhone, which is more meaningful than other mobile phones of the same generation.

 

2. From a technical perspective

 

From a technical point of view, the benefits of HTML5 are beyond doubt, especially in mobile device platforms with a dramatic increase in the number and functionality (many organizations and analysis articles have predicted that in the near future, mobile devices will surpass the number of desktop devices and become the first choice for people to access the Internet.) If you search the Internet and the sound of likes is also "difficult to read", let's take a look and think about it, whether there are still deficiencies in these new HTML5 features, or what are the traps in use-especially for mobile devices.

 

(Here we can see the increase or decrease of HTML5 compared with its predecessor: http://www.w3.org/tr/html5-diff /.)

 

Start with the newly added HTML5 elements. This part seems the simplest.

 

[HTML5 new typographical elements]

 

In the years before HTML5, we generally use tags such as <div> to divide a webpage document into different area blocks, HTML5 defines some new Basic Semantics that can be meaningful to define different areas of a document: <section>

 

The question is, when can developers freely use these new tags? Because users must upgrade their browsers (many users do not even know how to upgrade them) to see what the designers expect. This is not a simple task. Web developers with a little experience cannot forget the incompatibility nightmare between browsers in the Internet Explorer 6 era. Therefore, you must detect the browsers used by users in the code, then different implementations are provided. Any website with stable user traffic will not easily bear the consequences of the loss of old users due to compatibility issues to try new technologies.

 

This problem may be easily solved over time (for example, the popularity of Windows 7 piracy). In addition, some foreign talents of Niu X provide some technical solutions to solve the compatibility problem: "How To Get HTML5 working in IE and Firefox 2" http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/

 

[Video/audio]

 

If you vote, <video> may become one of the most familiar HTML5 new features, because Steve Jobs said that with HTML5 video, what should we do with flash? However, developers who haven't had time to be happy must have discovered a bunch of headaches, especially in video format. This is a problem that major browser vendors cannot solve when developing W3C standards, mainly because different video formats involve different patent fees and copyrights.

 

In short, there are two camps: H. 264 and webm (or you are more familiar with on2 Vp8), Apple and Microsoft belong to the former because they partially own their copyright; Google and Mozilla belong to the latter, although the latter may also have copyright issues, however, Google, the rich company, has cut it out and made it open-source. It also claims that developers can handle all copyright problems. Google even claims to discard support for H.264 format in Chrome's HTML5 <video> tag.

 

In this way, it is difficult for webmasters to decide how to provide video support, or this is what giants like Amazon like to offer "cloud. Users are even more likely to be kidnapped.

 

Therefore, the unification of platforms has always been the goal pursued by people, and may always be a goal. In the story of babeta, does God mean to let people speak different languages?

 

Canvas]

 

The canvas interface added to HTML5 is a plug‑profit device, which makes developers (especially in the gaming field) feel excited. This is equivalent to a browser (or HTML5 engine) at this level, the upper-layer application provides the graphic interface of the OS Operating System. Although it is not as powerful as local applications directly operate on the image library, it is enough to deal with many use cases.

 

Performance should be the biggest problem for canvas plotting, which should be similar to that for local applications (such as games. Local applications generally directly call the interface of the graphics library file. In the HTML5 world, web applications need to call the drawing API through JavaScript, and theoretically the performance will decrease. Fortunately, we have hardware acceleration, and mainstream browsers are moving in this direction. For example, ie9 promotes how many times faster we are than other browsers. In fact, this is mainly the result of hardware acceleration.

 

On some minor issues, we may also need to have a headache for the adaptation of different browsers. After all, different vendors cannot ensure that the canvas implementation effects are completely consistent. If one day we had a hard time writing an HTML5 game and scored chrome and ie9 after the release, it would be ironic.

 

Another problem is that we also need some JS graphics libraries (or frameworks) with high performance and stability, especially on mobile platforms. After all, developers do not want their code to be full of basic operations such as drawline and drawtext.

 

[Web socket]

 

This is also one of the new features that developers like to talk about. The client can use the websocket protocol to communicate with the host (supporting TLS encryption), which is more powerful, efficient, and less traffic than XMLHttpRequest, this is because after a websocket connection is established, its interactive message does not contain the repetitive information such as HTTP header. One obvious benefit is that the client can receive notifications initiated by the server without polling, similar to the push function. The implementation of websocket clients should be based on sockets in all major operating systems, at least in WebKit; it puts forward higher performance requirements for the server side than HTTP, because it is essentially a "persistent connection ".

 

In the sample code of many websockets, only a few words are exchanged with the server, but this is far from the "powerful function" of web socket. In practical applications, you need to face more complex network environments and use cases. You need to consider how to negotiate timeout and how to maintain connections through keep-alive messages, how to deal with sudden network interruptions (such as WiFi), or even server restart... for more details, see is websocket chat simple?" The question mentioned in this article: http://cometdaily.com/2010/03/02/is-websocket-chat-simple /.

 

Therefore, we may also need a network interface library-something similar to the graphics library, so that application developers can focus on the implementation of the application and its functions, instead of some basic logic and error handling mechanisms at the communication layer.

 

So far, it seems that no refreshing websocket application cases have been seen, which is enough to deserve the call before it came out. I am thinking that this new feature is actually used on the server side or on the cloud side, that is, the big guys. Both functions and interfaces are defined on the network side, while the "powerful" client does not depend on the cloud function definition. This is also in line with the current design and development philosophy of open platforms such as SNS and e-commerce. Let's wait and see.

 

Local Storage]

 

This is another new feature to be talked about. When someone introduced me at the earliest, the browser was able to browse the Web page offline. At that time, I was knowledgeable and did not want to understand what the technology was. Later, I learned that local storage is implemented in key/value mode, which is actually composed of two parts: sessionstorage and localstorage. The former is used to store data in a session, the data is accessible to different pages in the same session, and the data is destroyed after the session ends. Therefore, it is not a persistent local storage. Localstorage is used for persistent local storage. data will not expire unless the application actively deletes it.

 

Simply put, the former pays more attention to the "State" of the application and improves the cookie defect. The latter is equivalent to the browser (HTML5 engine) provides data serialization interfaces for upper-layer applications.

 

If HTML5 web pages or applications are improperly used for local storage, they may leave more and more junk data on the user's local disk. An error processor must be used to handle partial file damages; there may also be security issues. For example, if some important passwords are stored locally, other malicious programs can get them... in short, the new feature of local storage opens a door for developers, and there will certainly be various problems. We can only hope for its own perfection.

 

[Web worker]

 

Before HTML5, the JavaScript engine generally runs in a single thread, and the browser has only one thread running javascript programs at any time. Therefore, we can simply regard web worker as a javascript multithreading mechanism.

 

The basic principle of web worker is to use the worker class to open a new thread in the current JavaScript main thread to execute a piece of code unrelated to interface operations (usually occupying a certain CPU, memory consumption), to achieve the purpose of not blocking the UI thread, and provide the interface for data exchange between the main thread and the new thread. This seems to be relatively biased and advanced, so the opportunities exposed in various demos are not as good as web socket and local storage.

 

The abuse of web worker may lead to poor user experience. For example, if a developer develops an application on a machine with high hardware configuration, the worker may still work properly when the CPU is full, however, running on a machine with a lower configuration may be extremely slow, and prompts such as "this program has no response" will always appear like a nightmare...

 

3. double-edged sword

 

From this we can probably see that with the enhancement of HTML5 functions, it has higher requirements for developers. At the same time, because the larger Browser/HTML engine vendors have different standards, developers will face repeated debugging and adaptation on multiple platforms.

 

This is a universal problem. The more functions provided by any application or platform, the higher the complexity (which means the higher the development threshold), the more problems it brings, and the longer the stable period. Flash is such a huge cross-platform system. Although it has such problems, it is undeniable that, in many cases, flash applications are too poorly written (flash applications of many large companies are both dazzling and smooth), occupying too much CPU and memory, leading to system slowness.

 

In other words, the higher the development complexity of the platform, the more applications with poor experience, and the higher the probability of system problems-although its functions will become more powerful. This is a double-edged sword.

 

4. What are developers doing?

 

At present, there are already a lot of HTML5 DEMO code on the Internet, and even commercial web pages. Perhaps because it is still in its infancy, we can see more scattered features, rather than an integrated elephant. The wonder of the HTML technology is that people can always combine and implement powerful functions based on existing mature and scattered technologies, it's like html4 + CSS + Ajax + JSON +... these combinations are the same, so we also have reason to believe that the functions and effects displayed by mature HTML5 applications in a few years may make people forget the difference between them and local applications.

 

So What Are developers doing now? Some HTML enthusiasts, developers in the open-source community, and technical staff in the Forum I have come into contact... in general, there are the following categories (some of them are not strictly classified. After all, everyone is in the exploratory stage ):

 

1) framework or engine

 

As mentioned above, HTML5 does define many new interfaces, just as not any network application developer wants to directly operate the socket, developers certainly want to develop their own applications based on a set of powerful and stable libraries. For development like games, people need an engine to focus more on the creation of content and logic.

 

In the html4 era, there are many famous JS frameworks/libraries, such as prototype and jquery. (although all of them are called lightweight, they are still panting when running on mobile phones of the galaxy i9000 level, or even crash ). Nowadays, many companies are also providing their own game engines, extending support for HTML5 new interfaces, or rewriting frameworks/libraries previously used for desktop platforms to make them more suitable for mobile devices.

 

2) integration with specific operating systems

 

After all, HTML5 is just a set of standards, and the implementation of each platform is basically different. Some platforms also provide their own unique interfaces, so some companies will be on mainstream operating systems (such as open-source Android, make some adaptation or even improvement functions, such as a touch screen or even multi-touch game engine.

 

3) function improvement and enhancement

 

We know that the execution mechanism of HTML5 and JavaScript on the client is inherently inferior to that of the Local Binary application in terms of execution efficiency and graphics capabilities, in addition, the protection of code Intellectual Property Rights also exists. Therefore, some companies designed engines to be embedded into webpages only after pre-compilation on the server side, which is helpful for execution efficiency and code protection.

 

4) development tools and IDE

 

This seems to be something that can only be done by large companies such as Microsoft, IBM, and Adobe. However, some open-source communities or small organizations are still working hard, and their products may not be big and complete, but it must be because of some good feature that attracts users.

 

5) porting, demo, and re-engineering applications

 

In the early stage, the proportion of developers was perhaps the largest. For example, some interesting iOS or Android apps were implemented using HTML5, and some people used HTML5 to implement a famous arcade game. Some people may say that it is of little significance to do these things, but at least these applications make us see the power of HTML5: I did not expect it, some HTML5 games can run smoothly on my smartphone so quickly. In addition, you will take the lead in using new interfaces, encountering deeper problems, and gaining a lot of experience and valuable solutions during debugging.

 

6) media and publishing industry

 

In fact, this is what I personally hope to see: the traditional media and publishing industry can use HTML5 to occupy its own hill in the Internet field. After all, they are content producers, by making full use of the HTML5 release tool, they can win back some lost users in traditional fields. We (users) can also get better content (not just massive Internet junk information) through better user experience (cross-platform, better than html4) in fragment time ).

 

Of course, many developers are doing some interesting things and cannot list them one by one. As an individual, early exposure to new technologies is always beneficial and harmless. Many people may find that after learning HTML5 roughly, they still don't know what to do. Good applications often come from actual needs, rather than coming out of their imagination. There is a trend like this: I found that fewer and fewer people write "isolated-Island" applications (except for practice, demo, and customization), both for local applications and HTML5 applications. Companies and teams with strong and technical skills tend to be more willing to engage in frameworks, engines, and other infrastructure, or research and development that combines content production and cloud.

 

5. Summary

 

(At the end of the article, I found that there were too many things to be said and the Organization was not clear-because it was a technology in its initial stage, so I had to pull a little bit from the east. For this reason, the last section cannot be called a "conclusion", because I am not an Internet hero and have no conclusions. I will tentatively set a "conclusion" and I will try again later .)

 

  1. Currently, most of HTML5 fans are concentrated in the mobile Internet field, especially in the smartphone/tablet development field. Since, the popularity of mainstream mobile operating systems such as IOS, Android, and Web OS has aroused popularity in the smart mobile device market. Developers are delighted with the popularity of these devices, at the same time, it is also plagued by the split of multiple platforms and even versions on the same platform. Therefore, HTML5 has become the savior in the right time and place. After all, these mainstream operating systems have their own quite advanced HTML5 rendering engines.
  2. Although everything is still in its infancy and major manufacturers have different HTML5 implementations, we seem to have reason to believe that the HTML5 era will soon come. As the most cost-effective solution to cross-platform problems, I believe that there will always be people who will constantly overcome all kinds of difficulties and keep moving forward in exploration before there is no alternative solution.
  3. Compared with the desktop operating system, HTML5 may be of greater significance to mobile platforms. Many HTML5 leading companies or organizations will focus on the mobile device field. After all, on desktop devices, various mainstream operating systems have established a good software ecosystem. HTML5 applications should not be local applications (or even flash) for a foreseeable period of time) direct competitors: both in terms of functionality and performance.
  4. Compared with html4, the HTML5 development threshold has increased, which has a negative impact on its popularity, don't forget how much the popularity of html4 is due to its "programming that can be mastered as long as you copy/paste ". However, with the passage of time and the gradual improvement of various third-party libraries/frameworks, the chance of its popularity is still quite large.
  5. Why do HTML5 fans (note that this is a neutral term) seem to be more advanced than in the html4 era: it is still due to the popularity expectations of the mobile Internet industry, because there are too few good HTML5 developers at this stage. The pool is not big enough, and the industry is not big enough. Only more people, including those who do technology and do not do technology, can form a good ecosystem. Finally, this is also a high-profile era.
  6. HTML5 standards are still in the draft phase, especially the interface section, and there may be some variables. Therefore, few large commercial websites rush to use them in depth, after all, most users' browsers have not been upgraded to the HTML5 version.
  7. If the technology is also a bubble or noisy, you may have to calculate Android and HTML5 as well.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.