Since the end of 2010, there have been many voices about SilverLight's impending death. Then more and more facts have shown that Microsoft is indeed gradually giving up SilverLight. The fundamental reason is roughly because it feels the pressure of HTML5, and the direct reason is that it has not achieved much victory in the competition with Flash.
Because of the popularity of iPhone, Jobs confidently announced that all browser plug-ins are "evil", so iOS browsers reject any plug-ins, including Flash, and of course, SilverLight. Then, when the metro-ie in win8 is really like Jobs designed and does not support any plug-ins, I still couldn't believe that my glasses were broken. Why did Microsoft become so unconfident and independent?
1. Why HTML5 can't replace SilverLight (or Flash)Any product is a tool. I am not the designer of SilverLight and have no special feelings for it. If there is a better technology that can replace it, that's great. I will be the first to stand up to support a new product. But the question is, can HTML5 really replace SilverLight?
SilverLight is a fat client developed in C# (or vb.net) language. This lineage determines its development process innately. The program structure must be exactly the same as that of Windows applications. In fact, it goes a step further. The lineage inherited by SilverLight from WPF makes MVVM work very ideal. This complete set of products constitutes a powerful ecological chain based on .net framework, MVVM as the organizational model, and high-level language as the development language. SilverLight unifies the development technology of the client and server, and fills the gap between different browsers.
More than that. SilverLight is especially useful in the SOA working model. Its deep integration with WCF makes it simple and elegant to develop a powerful, service-oriented web program.
What about HTML5? It enhances graphics processing capabilities, adds streaming capabilities, and also adds some other practical functions. However, this is still far from RIA. It is useless for software engineering, performance, and development efficiency.
First of all, from the perspective of language and structure, the advantages of high-level language, strong typing, and object-oriented do not require any unnecessary explanation. The history of software over the past few decades has been iron evidence, and excellent design patterns are even more important to the readability, maintainability, security and flexibility of software. Regarding this, there is basically no need for extra "proof". Everyone who has learned programming should know the significance and role of design patterns.
HTML5 is not "HTML itself". In fact, there is a protagonist named JavaScript that is almost ignored by people. In all places where the wonderful prospects and cross-platform features of HTML5 are talked about, almost no one mentioned the name of JavaScript. However, in fact, various dynamic functions and behaviors in HTML must be implemented entirely by JS. HTML5, as a web application solution, should actually be called "HTML5 and JavaScript" solution.
In fact, if you think about it more carefully, you will find that JavaScript, which has been deliberately hidden behind the scenes by people, is the real number one protagonist, and HTML5 is actually just a supporting role.
Not too long ago, Microsoft showed a game called "cutting rope" that claims to be implemented with HTML5. The game is indeed surprising. However, anyone who works in web development should immediately realize that in the implementation of this game, HTML5 accounts for how much does JavaScript account for? Which language is its functional code in? The answer is so simple and clear. Rather than saying that this game is used to display html5, I think it is better to display javascript.
When it comes to games, you should be familiar with the popular web versions of online games in China in recent years. The powerful functions are completely realized by JS? It makes me feel numb if I think about it. Regardless of whether it is possible, even if it can be done, don’t you really think this is a major regression in programming history? ----After so many years of development, high-level languages have been replaced by scripting languages?
In fact, games are just an example. As web applications become more and more popular, people need stronger, more delicate, higher performance and more complex client applications, which all mean larger programming scales. For "html5 solutions", in fact, this means that all user expectations must be implemented through JavaScript, and for large applications, this may mean millions of lines of code. ---- In programming at this scale, is js comparable to powerful C#?
It's not just that.
For example, my company's project, web application focuses on local area networks and does not consider the limitations of the Internet. ----This is actually a usage scenario for many web applications. In LANs, client plug-ins like SilverLight can achieve very high-performance communication (binary data streams) and data processing. This is a barrier to the html5 lineage based on plain text interpretation. Its performance can never be higher than plug-ins.
In addition to communication performance, there are also dynamic effect performance. SilverLight can directly use hardware acceleration, while HTML5 relies on the browser, so just like communication performance, it will only be lower than SilverLight, and there is no higher possibility.
Is there any development efficiency (time cost)? SilverLight based on .Net can completely use the powerful functions of Visual Studio. Developers often don’t feel the difference between this and developing a Windows program. The .net framework encapsulates a large number of ready-made functions, rich controls, familiar programming experience, and powerful debugging support.
We are also familiar with the development of js. Although VS has been continuously strengthening its support for js over the years, compared with the huge .net framework and mature .net runtime and debugger, it is just a scripting language. No matter how fat a mouse is, it will not heavier than an elephant. This is basic common sense.
2. Where is HTML5Putting aside the above practical problems, where is HTML5?
First of all, HTML requires browser support. HTML5 itself is just a standard, and its implementation depends on the browser. For various reasons, each browser always has some of its own "personality". HTML4 is not without standards, but the facts in front of you have fully demonstrated how browser manufacturers will treat this standard. There is no reason to prove that the era of HTML5 can completely solve this problem.
Secondly, there are still only a few that support HTML5 browsers. It is still a long way to eliminate all old browsers. And it can be predicted that whether in five years or ten years, the market will be filled with various versions of browsers, and each browser will be somewhat different. In addition, how long has Microsoft's IE9 been launched? IE10 has been released. Although IE10 and IE9 are both browsers that support HTML5, there are many visible differences. Among the still-living browsers, Microsoft alone has 5 different products from ie6 to ie10.
Third, building a powerful web application not only requires maturity in basic technology, but also requires a large number of class libraries. HTML5 itself is not mature enough, and building complex web applications based on HTML5 (JS) lacks sufficient persuasion and class library support. If future browsers can really explain js like silverLight or flash, it will be a very long process, let alone I personally think that is impossible.
Compared to the immaturity of HTML5, SilverLight is a finished product in front of you. I worry about what will happen ten or twenty years later. That is because I am full and I have nothing to do.
3. Win8 and the futureWell, I admit that worrying about what will happen ten or twenty years later does not necessarily mean that you are full and have nothing to do. Then let’s take a look at the future.
Win8 is actually equivalent to win7+metro. That is to say, put aside the desktop mode that is backward compatible with win7, the metro mode is the real win8.
However, what is metro? The metro mode abandons the window, WPF, and even .net. At such a big price, it actually replicates the mobile operating system. Not only is it completely uninnovative in appearance, but the Windows application store also expresses its love for Apple directly. Considering the abnormal design of metro-ie... I once doubted whether win8 was developed under the guidance of Jobs.
Although the metro mode does look a bit refreshing, a personal computer is not a game console. More people have to use a computer to work, or do something similar to office. The more they use it, the more they find how painful it is to have a windowless metro mode. It is so common for people to use two or more applications at the same time. Moreover, because the size of the monitor continues to increase, the monitor actually has the ability to display more information every year, but metro tells users: No, all your screens can only be used to display one application. Do you want to chat with QQ while watching movies? Dear, that is not allowed...
Computers are not mobile phones. The designers of win8 didn't understand such a simple truth. Win8's metro cannot be said to be of no use, but it is indeed extremely limited in use.
Therefore, the future development direction of Windows will definitely not be a dull metro, but a classic window mode.
Once you understand this, you can believe that future I will not disable plug-ins. Even if Metro is still parasitic in the operating system like a deformed freak in win9, it will not cause any storm. The desktop-based win7 mode is the king, and as long as the browser does not disable plug-ins, there is no doubt about the availability of SilverLight or Flash. Although maybe Microsoft will not launch SilverLight 6 again, so what? SilverLight will still work well within at least ten years, as for what will happen ten years later... In fact, most of the code will not last for so long.
4. The nature of computer technologyThere is an old Chinese saying that "forget the ancestors of the numerology". For web applications, I think the genius of technology are forgetting the ancestors of the numerology. They are blindly fantasizing about cross-platforms, but forget what computer technology is used for?
Computers are a tool, and its entire development history is only to serve users. A technology that only brings a better experience to users is valuable and can defeat old technologies. It is unreasonable and stupid to pin the future of the web on low-level, typeless, difficult to control, low-performance JavaScript (HTML is basically used to present static content, and web applications focus on dynamic rather than static) is a foolish idea. When Jobs proudly claimed that all plug-ins are "evil", I agreed that his philosophy ("diction") made sense, but when he counted this dictionary, he forgot his "ancestor". (Applications must serve users)
A technology cannot suppress user needs just because it can save manpower, and it must consume more user computer resources unnecessary. On the contrary, if it can improve performance, save resources, achieve better results, and improve user experience, no matter how much effort it takes, it must be done.
In fact, there are many functions that JS+HTML cannot achieve, and JS+HTML is extremely poor in security. (Who can guarantee the security of online shopping?) It is impossible to disable plug-ins, not only in front of you, but also in ten years. Just think about the need for a stronger and safer web environment for users, you know that plug-ins can only be restricted, but they cannot be banned. (Some messy plug-ins are really annoying, but are they prohibited from eating fish because they have thorns? It is always stupid to give up eating because of choking)
Flash is a very excellent and powerful web plug-in, but it is not ideal in Microsoft's ecosystem, so it is actually unrealistic to use Flash instead of SilverLight. Either give up Microsoft's technology entirely or SilverLight is only.
In fact, I personally think that the future of the web should be based on the SOA mode of multiple clients. The functions are implemented by Service, and the UI is implemented by different platforms using the most appropriate technology. It is unreasonable to blindly pursue cross-platforms. The screen of the mobile phone determines that its display and operation mode must be different from that of the computer.
5. XAML, array binding and MVVMThis topic has been a bit bad, but I still have to mention it. The new development method of Win8 metro app, which can actually be called SilverLight6, still uses XAML, and it uses similar to "restricted .net framework" like SilverLight as a programming framework. Some silverLight programs can even be compiled directly into win8 apps without changing any line.
I am not optimistic about win8 and its metrol app, but I believe XAML and MVVM will last forever, WPF will not die, and the technology used by SilverLight will not die.
In a sense, even if SilverLight5 is really the last version, it can be considered that SilverLight has just changed its name, and it has been reborn in new technology.
6. Microsoft's attitudeMicrosoft stopped the development of SilverLight, but Microsoft never explicitly announced that the SilverLight project will be abandoned. This is a very interesting phenomenon. Microsoft's current regulations are "not allowed to mention it". If Microsoft is really determined to give up, why do you have to make an "not allowed to mention it" to pretend to be an ostrich?
I think Microsoft is also watching. They are watching whether the browser plug-in will really have no prospects. If other plug-ins, including flash, are slowly dying in the future, then Microsoft will naturally give up silverLight. On the contrary, if the browser plug-in is proven to be very comfortable and there is no sign of death, they can restart the SilverLight project at any time and launch SilverLight6.
So, I think even if SilverLight's reincarnation and rebirth are not considered, even the SilverLight product itself (and this name) is likely to be resurrected in the future.
Therefore, for web developers living under the sky of Microsoft, choosing SilverLight can achieve more powerful functions faster and more elegantly. Why not choose SilverLight?