Programmer sitting on the frame

xiaoxiao2021-03-31  183

That day I saw online, saying that writing C is too complicated.

Open the C tutorial, we will find that the syntax of C is very simple, the structure is very clear, how can it complicate? Later I found that he didn't say C language itself, but said the program written in C .

For a very simple example, through the MFC development application, in the engine's entry function is cwinapp :: InitInstance (); this function is automatically generated by appwizard;

Bool theapp :: initinstance () {

Afxoleinit (); // If you want to use the OLE object in your application, you must call it to initialize AFXRICHEDITINIT (); // If you want to use hypertext box in the application, you must call it to initialize AFXSocketinit (); // If you want to use the socket function, you must call it to initialize

}

When developing applications on the .NET framework, you don't need to consider the initialization problem of the entry of the program. When using the above corresponding functions, you don't need to consider the initialization problem, the developer only needs to concentrate on the business. Processing.

Through the comparison of the above two programs, we can easily discover that when you write programs through C , you must pay attention to the details of the procedure itself, or you must Note the logical detail problem of the program itself.

For example, in VB.NET, we developed through the .NET framework, when we need to use a Rich Edit Control on the form, we think that dragging from the toolbox to the form directly, So use Rich Edit Control because of the needs of business processing logic. When developing through MFC, we also drag and drop the RICH Edit Control control on the form, but we also take into account the logic executed by the program itself, call AFXRicheditinit in the InitInstance () method () The method is initialized.

These two developments are very considerable, in fact, there is nothing to say, we change a angle, from the perspective of engineering management, use VB.NET development, definitely better than use C . First, VB.NET's development efficiency is much higher than C , and other advantages, such as: garbage automatic recycling, type safety, etc., online. For such a fact, I don't have anything to say, it's all facts.

What I want to say is that now some of the programmers, they are really too big to rely on control functions, one turn open development tool, just see what controls are there, encounter problems, the first thing to think of thinking is this Does there have such a feature control in the development tool, if not, go online, if you can't find it, this function cannot be implemented. Yes, development is to make the development very simple. The manufacturers of various development tools have found this. In their new generation of development tools, join and have a lot of new, powerful controls, more Sally, the template for solutions allows developers to set an IT solution with a mouse setting.

When this part develops multi-year programmers to see the procedures written in C , they will feel complicated. In fact, the program itself is that look, just a long time, the real face of the program itself is covered by a variety of powerful frames. Many itself should be completed by programmers, and the processing logic completed by programmers is automatically completed by the framework. I am not here to give up the use of the frame, what code is written, this is not scientific. I just want to remind you to write a procedure, when you write a program through the framework, don't forget that there is another program behind this program.

转载请注明原文地址:https://www.9cbs.com/read-130862.html

New Post(0)