"Programming Master Proverbs" after reading # 1

zhaozj2021-02-08  267

After a few years, I have also seen a lot of things. Sometimes I want to write something, but I always feel a lot of clues, and I have not had a pen. Recently, I have turned a "programming master rumor", and suddenly wanted to write something, right to write something in the form of reading notes. The release "rumor" on the equity is the following is the I'm of myself. I hope everyone can advise, but they don't have to be, thank you. Note: This part involves the first chapter of "Proverbs".

In this area of ​​PC, the current program is not equal to software. ======================================== 现在 程序 程序 程序 程序 软件 软件 软件The program is equal to software? I think, no matter when, there is useful and no programs, and software, Software, you should refer to those useful procedures, regardless of these procedures. Oh, you should be this useful procedure for you or for others, then we can say that we are writing software.

The functions of commercial software and the goals to achieve are not a person who can "play". This is the reason why the new software company is not produced. For example, Netscape Netscape is a new software company generated in 1995 to 1996, but he won't see two or three years later. ============================================================================================================================================================================================================= ============================== 所 所 商 商 功能 功能 功能 严 定 严 定 严 定, Definition. What is commercial software? Look at the amount of code in the release? See the size of the program? Look at the algorithm with complex gods? Look at there is no excellent after-sales service? Still simply call the big company called business software? Of course, now in some general areas, some doins do not involve complex algorithms design, some existing companies have entered, and the power of individuals can do almost unlikely to compete with big companies. However, computer science is a wide range of disciplines, many branches, such as digital image processing, video audio processing, artificial intelligence and robot, and so on, as long as some people have achieved breakthrough discovery, I want to quickly form commercial software. may. Of course, it is likely that the small companies that have just appeared will soon be mounted by those giants. If you look at the development trajectory of these giant Mac, you will find that the small company who has just appeared is home to the house. But even if so, Silicon Valley still has many small software companies. After all, the software industry is single on the plane of the giant Mac, and the circle and round coincide will always have a gap. As for the disappearance of Netscape, everyone understands that more is not depends on technology. In fact, Microsoft enters this area too straightforward, and there is already Visual Studio and MS Office on the software, so developing browser technology is almost ready-made. Even if the Microsoft's IE is done on the basis of NCSA Mosaic. So Netscape is not acquired, but it is completely defeated.

The threshold for any industry is very low, but, as long as it is developed to a certain stage, its threshold will inevitably raise. ============================================================================================================================================================================================================= ========================================== The author agrees with this sentence, the software industry is too important. What is the most beneficial to the most benefits, and later people are usually a part of it. Two days ago looked at a funny flash, suddenly an idea, how did I not think about writing a plugin in the browser to support animation and music. Oh, it is still a single level of individuals. It will take a few minutes before going to bed every day. If you are thinking that you will think of a point from this step, huh, huh. Now China's software industry is forming, so now make a programmer must have patience. ============================================================================================================================================================================================================= ========= I think the programmer does not care about it, patience can be said to be the essential quality of software developers, and is reflected in all aspects: there is no patience when writing procedures. You will wait after it. Catch the insects; when you charge yourself, you have no patience, then you can only master the skin, you will have no patience when you chase your friends, then you just ..., halo, how to throw tomatoes Come over, I flash :-)

You must make all the questions and then do the program. ===================================================Deficient design is the brain force The lives, while the rapid improvement of software development is constantly improving. When I dare, I dare, I hope that all the questions are clear. In fact, every developer, oh, no, :-) is that I have always discovered new problems in the process of development, and constantly solving the problem, it is a spiral process. I have always thought that learning is the fastest and most effective in development.

In fact, the US commercial compiler is not a person who can "play". Now you may feel very simple, and even Linux also has a GCC, and the source program is still there. You can change it once, do a VC to try it, see if it will be used? Even if you do another interface, it is also GCC, which will never be able to commercialize as Visual C . ============================================================================================================================================================================================================= ========================================== I still have seen a chapter, I have seen a chapter. Said that Borland's original Turbo Pascal is mainly written by a cattle cattle. Oh, if someone writes a similar VC interface, I will give my hands and feet. I will help him test :-) Sometimes I am thinking, Borland does not use PASCAL when developing Delphi, now the market share of the development tool Will it be a pattern? (I definitely didn't look down on Pascal, in fact my first language is PASCAL, just because the PASCAL book in the library was taken by people C) If I wrote an interface for GCC Of course, or GCC. People who have used GCC never say that GCC is better than Visual C , and there is no way to ratio, not in a quantitude. GCC is a powerful compiler that supports N hardware platforms and official software standards, and has also introduced many software developers' urgency. Most excellent libraries, unable to compile them on GCC. Hey, is there an advertisement for GCC? As for the commercialization of GCC, I have seen some companies selling hardware products, and their included compilers are GCC or their variants. Besides, a large number of large software can be compiled with GCC, and I don't think about Visual C from stabilization. In fact, I encountered the so-called Internal Error when I used Visual C , and I used GCC, I have never encountered this inexplicable internal error complaint. I think the GCC has the potential to have the potential of commercial software. Oh, it is not visualization than Visual C , although there are also some GCC's graphics front end.

The opportunity is generated from patience, the more patience, the more opportunities. ========================================================================================================== Ah, the opportunity is coming, huh, huh. Do you still have a hard work, don't really have a good opportunity, huh, huh ~~ If you start from the MFC, or start from VC, then you have to make a real-world-wide domain. Software will take a lot of detours. ============================================================================================================================================================================================================= ========================================== 去 去, how to get from MFC or Will VB will take a lot of detours? The Win32 API is called from the MFC or VB, especially in Visual C MFC. "Proverbs" looks at the bottom, is the Win32 API is not under the bottom? Do you have to write true universal software in assembly levels? Then I simply go to the CPU to write the microcode, huh, huh ~~~. VB I used very little, I don't say it. As for MFC, if you really understand MFC, then you are almost all proficient in all aspects of Windows (Of course, I refer to Dongdong's Nuclear Users Space). Computer this thing is that hardware or software is important. An important aspect of development is to figure out what you need to do at what level you need. A developer who writes the middleware with Java, how much is it necessary to go to the underlying thing? I think if you don't make it on your own level, and you can engage in cross-layer things, the result may be a force without please. It is still dangerous if you are studying in your work, if you don't know like this, huh, it is dangerous. Of course, I didn't let everyone not drilla, but I think it is best to ask for a predecessor to ask for it, and make my own study plan according to my interest. After all, people have limited, we have to put limited energy into the people's services, but don't waste it, huh, huh.

Just want to mix orange rice, find a job, may teach you the book that has become MFC's master, it is enough. ============================================================================================================================================================================================================= ================ The commes of the present now is so happy, and the domestic states have been introduced abroad. It is really not much about foreign reference books when you are about 95 years. I suggest that everyone is looking for foreigners in the computer field. It is not that I worship, and the old foreign book is basically quite responsible, and most of the domestic introduction is not bad. But even if you are cultivating foreign bows about MFC books, if you don't care, you can't be MFC master. There are many people in the design of MFC, and we haven't mentioned it, but if you really go deep into the source code of MFC, others don't know, but you can definitely have a deeper working on Windows. Understanding. Start from the lowest layer, sit up from the most basically. ============================ The view is from the intermediate layer. Take Java on Win32 as an example, I will never start from Java Virtual Machine Specification, Java, and Native System Interaction, and the implementation of Java garbage collection algorithm, etc. It will not be involved in what design mode, the high-level abstraction such as the FrameWord framework. I will start from the Java language itself, familiar with its grammar, familiar with its basic library, try to use Java description questions. In this process, you will naturally meet some or high-level or underlying problems. At this time, you are absolutely not late, and you can only be half a way.

The six phases of the master growth ================== "Proverbs" one book divided the growth of programmers into six phases. But the author believes that only the first phase, that is, skilled use of a language is necessary for each programmer. Other capabilities should be different for different development directions. For example, "rumors" believe that the second phase is an interface (such as Win32 API) that is proficient in some platform. However, many comrades doing high-level development often do not touch these underlying APIs, because on him, the operating system has been superimposed on a lot of level. For example, if you use Java to program it on Win32, it is hard to deal with the system API. This actually reflects the idea of ​​software layering: Each layer is only responsible for his own functions, only communicates with your own adjacent layers. "Proverbs" believes that the VXD programming can be performed, or the modification of the operating system kernel has entered a high level. Not to mention VXD has been abandoned by Microsoft, the new Win32 drive model WDM, Linux / FreeBSD Kernel's small modification author has touched, but I never think that I have reached a high level, especially those who do high-level development. Friends ratio. Because there is really no way, the comparison is to do on the same level, how do you compare different levels? Even if you design the operating system, if you let you plan an ERP system, you may not succeed. Besides, I wrote WDM, I feel that WDM is not so mysterious. But the revealed if I design a ERP Framework, I feel that many things need to learn, I want to be the same. As for the ground development, the difficulty should probably be relatively small and examples of examples (especially below Win32), less friendly debugging tools, and less system support. For example, when doing application development, development environments often have a complete debugging tool, and it is not easy to kill the entire operating system. However, doing Kernel development is different, and if the operating system is collapsed. I remember that when I was developing WDM, I hanged the second hard disk, ready to ghost, huh, huh. At this time, Win32 or Linux has no difference in your eyes. =========================================== From the perspective of the operating system, Win32 and Linux are both operating systems, nothing difference. However, involving specific development, you have to make a clear understanding of the differences, the user state program is still better, and several important issues, such as thread, message mechanism, GUI, etc. are like abstract. QT, GTK is done, you can implement a cross-platform for Win32 and Linux. However, in the kernel, the two differences are very large, I have never seen any Driver develop library can be well cross-platform in Win32 and Linux. The closest I have seen may be the C library of Driver Works. BTW, maybe there is any good library, I don't know, I hope that the friend who knows is not letting me :-)

The primary programmer he will think that VB can also make an application, and he may not choose VB to the intermediate programmer, and may use MFC. When you go to a senior programmer, he is definitely not first choosing the above tools, and what is absolutely considered is a solution to solving the fastest and most stable performance. ============================================================================================================================================================================================================= ================================================================================================================================================================ 的Go together, no matter what development tool you use, you are not at home, you are a primary programmer, not to say that you have chosen a seemingly high-end development tool. You have a high level. Both of VB and MFC are different concepts, no more than! As for the senior programmer, I think "rumors" is still right. I have a teacher to divide a large project into multiple pieces, and each piece has chosen the appropriate development tool, and finally the project is successful. Every time I see someone in the forum is discussing the pros and indices of development tools, I want to fall under the discussion. No tool is perfect, and smart people should do the correct assessment according to the situation of their own project. You think about it, if you really come out, how do you survive other people? When the highest realm, I thought about "I am the program, the program is me." =============================================== "I am program, the program is I ", is this? The difference between human brain and computers is undoubtedly, otherwise it will not have a revolutionary progress in the artificial intelligence. I think the highest realm should be to recognize the huge difference between the human brain and the computer, try to use the program to bring the bridge to allow them to communicate. In fact, we think that in the data structure, many of the concepts in the operating system do not directly reflect some of the experience of human life? (For example, a fast algorithm, various synchronization and Cache technology. I think, let the computer adapt to the human brain, how can it be possible?

If you reach the state of the master, you are the operating system, you can do any procedures. =========================================== 假 假 假 我 我 我 操作 操作 操作Can I do any procedure? The operating system is not a special thing, it is to manage hardware resources for us. What is the program? The program is a collection of code to solve the problem. The function of the operating system is constrained by hardware resource, and the problem that humans needs to be solved is to be exhausted. In fact, the technology reaches the highest realm, it is no separate. ===================================== For the same technique, it is a relatively high realm, it is indeed Communicating. why? In fact, you can understand that you are all solved a specific problem. How do you also avoid it in this feature? For example, if you do a distributed database, the problem of data consistency is a problem with the distributed database, no matter what method you use, you will eventually return to this issue. However, this so-called no difference is only conceptual, you don't want to expect you to understand Microsoft's DCOM, you can quickly get the SUN distributed technology. I think this is the place where we do these software guys. If there is a standardized organization to define a strict specification, we can save a lot of things.

The author said that Microsoft's "old man" can do virtual windows on 64-bit machines, then "Microsoft's technology is not advanced? Is Linux? Can you get it? ========= ============================================================================================================================================================================================================= =========================== 去, is it very cattle? This is not a few operating systems on the CPU? What new ideas, do not talk about the ability of the Java environment with preliminary virtual computer, SourceForge ranked Bochs before the test is a very good X86 simulator, I ran a small Linux on it. Besides, now VMware, performance is already very good, my colleagues can run Win2000 in VMware in the PII350 machine, what is the 64-bit machine? Again, 64 power is in the same time Operating system, will not? Microsoft's technology is very strong, the latest technology of the world computer is absolutely concentrated in these people (referring to the microsoft design kernel). =============== ============================================================================================================================================================================================================= ===================== Halo, the computer is a large-scale discipline involving a wide range, the operating system is all the computer? I don't see it. We don't see it. Look at Microsoft's development track, you can see its "original" is actually not imagined. Microsoft itself is not from advanced technology. I want "rumors" to give some Microsoft's latest and others do not Technology, I am afraid it is not easy. (Maybe it is also locked in Bill's safe, I don't know, huh, huh)

Especially now a lot of programmers are misleaded from the MFC, which is easy to form a closed thinking mode. ============================================================================================================================================================================================================= ====================== Weird, how did you start from MFC? How to get a closed thinking mode from MFC? MFC is probably the thinner of the Win32 API package. And on the study of MFC, you have to go deep into the source code level sooner or later. You think that Microsoft has always been a treasure for the source code, but it still publics the source code of the MFC, why? Obviously, Microsoft understands the MFC package is imperfect, it is almost encouraged you to do itself. Do you want us even if you open a window, you have to do those manually prepared resource files, register window classes, large CASE statements to process messages distribute, and messages are "missions"? I remember that I had to do those stupid annoyed in Borland C 3.1, and even wrote a small program to generate thousands of code. So I think that MFC will not form a closed thinking model, but the opposite! Oh, if the MFC designer sees "rumors", I don't know why I don't know how I don't know. When you can become a senior programmer, these are disdainful to MFC. ============================================================================================================================================================================================================= == From the perspective of C power, the MFC's package is indeed not the highest, but if you look at its source code, the flash point is both everywhere. I don't know if "rumors" think of the macro of the C syntax to construct the message processing system? I don't think there is a person who knows deeply on the system and language. I am afraid I won't want to get it. Microsoft as a big company, there are a lot of cattle people who are normal. There is a regular expression library on research.microsoft.com that Microsoft is implemented in C , and now the regular expression library is not asgens, but Microsoft is using C template to construct automato, indeed, no loss, it is said Performance is not bad. Therefore, the MFC can exist in Microsoft's products for so many years, not for the reason. Oh, I also hope that I have the day that I can dismiss for MFC :-)

The correct programming idea is to be paired, first write the braces above, then write below. When you want to use a memory, write an assignment function Assign a memory, then write the code that releases this memory. ============================================================================================================================================================================================================= =====================================, for braces, different coding specifications have different Definition, I don't have to force it to force, as for the "rumor", I'm looking for it, I can't stand the feet. A little better editor, such as GNU Emacs, supports automatic matching of parentheses, where to use it to find it, not tired. As for the distribution and release of memory, this is a C / C eternal topic. If it is so easy to solve it, it will not be discussed for so many years. You think that many times are allocated in this place and released in other places, and this elsewhere may be in other people's programs. For example, in the Linux network card driver, it is possible to release a lot of other high-level protocol handlers (of course, for a specific memory, will only be released once), how can you make a pair of encoding? The integrated environment is first set to 8, because the basic definition of Tab is 8, and the current VC is set to 4, so that your program is placed in a standard environment, it is chaos. ============================================================================================================================================================================================================= ==================================== should be used to tab is 4 style, but I still Due to the test, in the VC environment written in Tab, the code written in UltraEdit did not have a problem. I don't know what standard environment for "rumors" is used, huh, huh ~~~

If you don't understand the code written, it is definitely garbage. ============================================================================================================================================================================================================= ====================================== I think this can be more than this sentence, if you write Everyone is not understanding, it is definitely garbage. Oh, how can you so arbitrarily? What code is garbage? I want to express the code you can't understand with someone else, that is the garbage. This code is very harmful, which is not conducive to maintaining a lot of bugs. Here you can give an example, a website collects a lot of C-source programs that are difficult to understand, some are still in a thing that is unpredictable. However, after I came back, many of them can't succeed in the mainstream compiler. For example, after you download a "bad" program from Linux or online. ===================================================== 看言Conceying the procedures in Linux and those "bad" programs, I don't understand where it comes from. How can I not see a lot of excellent source programs in Linux, huh, I don't want to say more, everyone has their own eyes.

(Linux) Those programs are still upgraded, that will have a new version, if you take him, don't have any value for you. ============================================================================================================================================================================================================= ==================================== No value? ! I don't know, I understand myself, I can frankly say that I will benefit from Linux / BSD code. All aspects, algorithms, system architectures, hardware, etc. can benefit from these excellent code. I hope everyone should not listen to the "rumors" statement. If you have time to read the source code according to your own interests, guarantee Not a lot. In terms of the things that are excellent in super-tie, some players in the Linux community are very excellent. And free, source code is all, as long as you are high, I want to change it, how good. I don't know what the intentions of the above words are in "rumors". VC automatically generates a bunch of spam frames, which may be more "stinky relative to online Linux programs. ============================================================================================================================================================================================================= ==================================== Oh, it is naked to the attack on VC, honestly say that I am indeed I rarely listen to people that VC generate is garbage code, and very few listening people say that these codes are stinky. Do you have to use pure C to give Win32 programming?

Linux is an operating system, very powerful! In fact, those programs are coming back, patiently read it, will find that it is very chaos. ============================================================================================================================================================================================================= ==================================== Is it possible to compare with ordinary applications? I have read the source code of the network part of Linux and the file system. I didn't feel "chaos very". Operating system program direct architecture is in hardware, of course, the ordinary program is different, you have to use the ordinary application's writing vision to see the operating system's code, I think this can only show that your method is not right. The actual situation is that the core code in Linux has been refined several times, there are a lot of good things in it. The procedures that some cattle people write down on the in-depth understanding of C and hardware systems can make the later people benefit. Don't say some special occasions, those big cows will write down the "dirty" code in the case of no way, watching those who are humorous, often you will laugh, from my heart admire those people Level and rate. All programs are commissioned, not written. ===================================== Hawthorn, don't you write it? Besides, nor the system you can slowly slowly. Many large software codes are very large, where it is possible to make you slowly pondering in compilation, I think there is only a few key parts. So good software They are slowly changed slowly in the area where the efficiency is very sensitive.

INT i; extern int in [], out []; for (i = 0; i <100; i ) {OUT [i] * = in [i];} ============ ============ Oh, beware of OUT [x] overflows the negative number thus does not match your expectations.

If any system is compiled, it will definitely have a lot of performance issues, including all kinds of problems that may have unpredictable. ============================================================================================================================================================================================================= =====================================. Now the hardware tells the development, many times the performance consideration has been put The position is up. We are more about the understandability of the code. As for problems that may have unpredictable, I want to do something yourself without using some test libraries, possibly more. Take me as an example, after I use STL, I will no longer have a pointer problem for the use of common data institutions. It is possible to be a compiler error, or it is possible to add anything in your program, and the program is interfered. ============================================================================================================================================================================================================= ===================================== 记得 得 怨 怨 编 怨 编 怨 问题However, the less, the less complaints, there is almost all. Just like it now, if you play the latest patch to Visual C , you want to find a BUG, ​​it is not easy. As for new problems in the program, this is normal, so some source control software is needed to track software modifications.

A very common design thinking in the MFC is anything, just created, regardless of the release and destruction. This idea is the reason why many programmers do now will crash. MFC makes you do this, that is, you will never become a master, and your procedures you write will never be stable. ============================================================================================================================================================================================================= ==================================== I have been programmed in the MFC. How is the first? I heard that anything is only created, regardless of the release and revoking? There is also "rumor" how to know that MFC is not a "master"? Oh, I am so good to design MFC people, actually say that the procedure written by MFC will never be stable. Any software must be associated with a platform, and the software above the platform is almost unused. ============================================================================================================================================================================================================= ========================= I don't know what "rumors" so-called platform, and many programs in the open source field are cross-operated systems and hardware platforms. of. Why can I say this? Very simple, c can be across hardware platforms and software platforms, and many libraries take into account different software platforms when designing, so on the basis of writing cross-platform software is directly. For example, Borland claims that the Delphi program on Win32 can run on Kylix / Linux.

A very ordinary programmer, if he can consider dividing the program into several dynamic libraries, then his thinking is already open, it is not the MFC's thinking. ============================================================================================================================================================================================================= ========================== Software uses the DLL implementation called open thinking, it is so simple, huh, huh. The MFC seems to have not limited you in the program with a DLL, and even the dynamic connection MFC program requires an MFC dynamic connection library in the target system. The VC wizard seems to have a Wizard that generates the DLL. You look at the MFC's idea, that is, a layer of set, you have to implement all classes, then inherit. After he went from CWND, he included all things in and then formed a giant class. This giant category interface is included in the implementation system. How do you remove it at this time? There is no way to remove it, this is closed thinking. ============================================================================================================================================================================================================= ===================================== inherited, of course, a layer of set! MFC as a Framework, what is the other class? Let's take a look at the class diagram of the MFC. It seems to have many inheritance relationships below CWnd? CWND as an abstraction to Win32, its complexity is born, because the window in Win32 is originally a complex concept, the management, self-painting, message processing, etc. of various resources is designed. As for the split, I read it is easy, I realize a new window class, I will derive from CWND, not the window class, and what Serialize is to support, then I will derive it from COBJECT. Either I simply realize my own class hierarchy system. MFC-based interface library like BCGsoft is a lot of to replace MFC with their own classes, and they have not listened to their complaints that MFC can't expand.

The chance of each small function error will be small, then the chance of combining the entire program is very small. ============================================================================================================================================================================================================= ================= Software design is an annoying place, sometimes it is not a simple 1 1 = 2, we often say joint debugging, if you really widget OK, The big system is OK, we still need to coordinate. For the principle of splitting, there may be no universal and can be implemented. But when you design, you should try to think about those principles in the software project, such as what is loose coupling, is always right. Dynamic libraries, including its code and data are independent, never follow other dynamic library strings. But if you put all the features in an EXE project, his data and code are put together, and finally, it will interfere with each other. ============================================================================================================================================================================================================= ===================================== Who can't interfere with each other, don't forget, once the DLL Loaded, it will map to your program address space. A lot of DLL injection in the discussion is not a typical version of the DLL interference host program running? Of course, this interference has a benign and malignant difference.

General software is a row, and the result of each line is to reach a predictability. ============================================================================================================================================================================================================= ==================================== From the context of "rumors", it seems that it is not recommended to use some The ready-made library is advocating what you have written. Don't forget, there are many industrial strength libraries, such as STL is testing, and the code generated by the development tool is those who are very dead. I think artificial to write is less efficient, but it is easy to make mistakes. . If you don't trust the development tool, simply write the machine code, but is this possible? That is, from the symptoms, it can judge which code produces a problem. ========================================== If you can know from the symptoms of the software Which code has a problem, I think Microsoft will not include a large stack of system image data in its error code report. In particular, after the complexity of software is improved, the cause of the problem is often complex, interleaving. A prominent sign of the master relative to ordinary people is to accurately position the problem that the problem can be directly or with the debugger. Of course, if the program is not large, it is still possible to locate the problem based on the symptoms.

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

New Post(0)