C # vs. c ++/C: analysis from the perspective of technical management (Appendix: potential competitor analysis of. net in the desktop field)

Source: Internet
Author: User

A product is composed of a series of attributes, such as price, performance, and mobility. ForProgramDevelopment languages are performance, development speed, and maintainability. For a product attribute, the higher the property, the better, as long as it is high enough. For the vast majority of people, the requirement on products is not "best", but "good enough ". When it is good enough, people will pay attention to other attributes.

For example, the more people eat, the better the food. When people are full, they will think about other inboxes. For a computer, when the performance of a computer is sufficient, we may require it to be portable. When it is portable, our focus may be on standby time or other requirements.

Therefore, the assumption in this article is that there is a line of satisfaction for a certain property of a product on the market. Beyond this line of satisfaction, it can be accepted by the market, the main battlefield where different products compete will switch from one property to another.

The market is diversified, and each market has different requirements on attributes. I will draw a simple figure () in which the horizontal coordinate is time and the vertical coordinate is the performance of the program. In order to simplify the discussion, we will only talk about performance here. For others, we can use similar analysis methods for analysis. In general, with the development of time, the program performance is gradually improved. We assume that the performance of C # is lower than that of C ++, Which is 0. X times that of the other party. Assume that there are four markets A, B, C, and D. The four markets have different requirements on program performance. A has the highest requirements, B is followed by C, and D is the least. The market expectation for performance is also rising. The common situation is that the above model: the market demand for performance is increasing gradually, and the performance of products is also increasing gradually, however, the latter is faster than the former.

There are three time points. At the time point 1, C # is not yet born, and the performance of C/C ++ can meet the needs of the D market. Haha, at this time, the technical staff in the D market have chosen C/C ++ development. At this time, developers in the, B, and C markets cannot write a single statement. At the time point 2, C/C ++ can meet the needs of the four markets A, B, C, and D. C # has also developed to meet the needs of the C and D markets. At this time, the technical staff in the C and D markets no longer care about the performance of C # When selecting the technology. Their focus is on performance issues, C # is superior to C/C ++ in terms of fast development and maintainability. In this case, selecting C # is the correct choice. Developers in the and B markets will never consider C #, because the performance is not high. Time continues to grow. At the time point 3, some pioneers of B suddenly found that C # can meet their performance requirements, C # eroded the C/C ++ market.

Of course, things in the world are much more complicated than this. This figure is just a simplified explanation. The two core texts above mean:

(1) our requirements for most things are only good enough, not the best. When one aspect is good enough, people's concerns will quickly switch to other aspects;

(2) due to the poor interconnectivity between the market, deadly competitors often lie in other fields, rather than the technologies currently in positive competition.

For the second (2) Point, draw a picture to explain:

There are only two markets A and B in this figure, which are far apart. There are three technologies: A, B, and C. At the time point 1, only a and B can meet the requirements of market. As a result, the two technologies, A and B, are constantly involved. At this time, although C technology has developed, it still cannot meet the needs of a market, and a market does not have the shadow of C technology. In the eyes of Party A and Party B, they only know each other. It's time to start 3. A and B are still playing. This is a market discovery that C technology can meet their needs, C technology also has other advantages that a and B technology does not possess. Then C technology quickly spread in the market, and a technology and B technology were dumpfounded ...... This is how the market changes rapidly. How does Motorola decline?

Switch to C/C ++/C #. It can be inferred that C # will gradually erode the existing market of C/C ++, from D to C to B to ......

But --

(1) considering the existing investment in C/C ++, it may not be completely transferred to new technologies.

(2) other markets, such as embedded, are currently developing fiercely. In this rapidly developing field, C is often the first technology to meet the needs (such as performance, memory usage, compiler complexity, etc.) C ++ is the second, C # is the last. Therefore, C # encroaches on the old market of C/C ++, and C/C ++ keeps entering the new market. If the expansion speed of C/C ++ is greater than the speed at which it is eroded, C/C ++ continues to expand in terms of language shares.

In terms of technology selection, we need to check whether the technology is enough in some aspects, and then consider multiple aspects for decision-making, rather than whether the technology is the most Nb-effective.

==================

What I want to talk about in this article is not the above, but the following --

Hey, you are yellow. C # is encroaching on C/C ++, but a potential competitor may threaten. Net's future position in desktop development. At present, most people do not know much about this potential enemy. This article focuses on introducing this potential competitor.

Flash is a potential competitor. The mainstream flash market is online advertising, followed by video websites. This market is completely different from desktop development! However, let me hear one by one:

(1) Flash is a virtual machine platform that is cross-platform and can be applied on many mobile phones. We may have thought that. Net is a platform and Java is a platform, but flash is also a platform. There is no essential difference between the three platforms. In theory, flash can also support multiple languages. In fact, related projects have been started. Flash/air can run on the desktop.

(2) the mainstream flash language as3 is very powerful. It is not like Amon in the past. Apart from its slightly different syntax, it is almost the most similar to C. There are attributes, events, functions, interfaces, exceptions, powerful static type systems, dynamic classes, and reflection, remote (as3 remote is very useful !), Of course, there are also many deficiencies. The most important thing is lack of generic type. As3 performance is also very good. My simple test result is that the Flash program is about 80% of the performance of the SL program, instead of unsafe. the SL performance is equivalent to that of WPF. Refactoring: All unit tests are supported.

(3) On the UI, the corresponding Flash/flex is WPF + Silverlight, not Silverlight. Currently, Flex is 4.0. As for HTML5, soy sauce is still in use. In addition to this sentence, this article will not mention it any more.

(4) On the IDE, flash builder is very useful. There are also the ancient flash and the new flash catalyst. Flash now has three official ides with different positioning options to meet different needs.

Next, we will use a simple hello World to demonstrate the similarities between flash development and. NET development.

Is flash builder. Because it is developed on the basis of Eclipse, you can get started quickly with eclipse experience. At the same time, its development mode is very similar to that of WPF development in. However, WPF cannot drag controls before vs2010, and Flash Builder (Flex builder) can be dragged very early. At the same time, flex also provides many existing controls. Above, I dragged two controls, one label and one button. Then in size and position, I set the positioning constraint of this button in the lower right corner.

Is an official control. The common ones are all available.

Is the property panel, which contains the properties and events of the button. Events with the "lightning" icon. Double-click to automatically generate a method. For example, double-click can generate:

Protected function button#clickhandler (Event: mouseevent): void
{
}

When you click it, display the label helloworld. You can add the following content to the method body:

This.txt. Text = "Hello world .";

So far, only this row has been written.Code. Run the command to obtain the following information:

The complete code is as follows:

<? XML version = "1.0" encoding = "UTF-8"?>
<S: Drawing wedapplication xmlns: FX = "http://ns.adobe.com/mxml/2009"
Xmlns: S = "Library: // ns.adobe.com/flex/spark"
Xmlns: MX = "Library: // ns.adobe.com/flex/mx" width = "375" Height = "242">


protected function button#clickhandler (Event: mouseevent): void
{< br> this.txt. TEXT = "Hello world. ";
}< br>]>

<FX: declarations>
<! -- Place non-visual elements (e.g., services, value objects) Here -->
</FX: declarations>
<S: button label = "Click me" Click = "button?clickhandler (event)" Right = "10" Bottom = "10"/>
<S: Label x = "42" Y = "48" id = "TXT"/>
</S: windowedapplication>

Flash data binding is very simple. Rewrite to data binding version:


xmlns: S = "Library: // ns.adobe.com/flex/spark"
xmlns: MX = "Library: // ns.adobe.com/flex/mx "width =" 375 "Height =" 242 ">


[Bindable]
private var message: string;
protected function button#clickhandler (Event: mouseevent): void
{< br> This. message = "Hello World";
}< br>]>

<FX: declarations>
<! -- Place non-visual elements (e.g., services, value objects) Here -->
</FX: declarations>
<S: button label = "Click me" Click = "button?clickhandler (event)" Right = "10" Bottom = "10"/>
<S: Label x = "42" Y = "48" text = "{This. Message}"/>
</S: windowedapplication>

In the past few years, Flash has quietly arranged its positions, and now the positions have been formed. Because of the focus on the UI, this virtual machine is very small, and the language is also very practical and lightweight. Deployed on the desktop is only 10 MB, and the size of a similar WPF program is 30 mb-40 MB. At the same time, it is still cross-platform. In addition, there is little difference between browser applications and local applications. The development speed is also very fast, which is not much slower than. NET development. Http://www.taaz.com/makeover.html this is a very Nb flash web program, I only took 5 weeks to achieve it in addition to the main features of custom models!

At present, flash still has some major defects, such as the maturity of virtual machines is still insufficient, and desktop programs do not currently support local calls. The former relies on time to improve, and the latter also needs to wait. If these are implemented, it will be a great threat to C # on the desktop! However, at present,. Net still does not care about the existence of flash, and everyone thinks that flash is still a web advertisement.

 

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.