Random Thoughts (learning method of open source code)

Source: Internet
Author: User
Tags lua tightvnc

Turn from: http://blog.csdn.net/feixiaoxing/article/details/7749331?reload


First, History

Open source code as a feature of the product, with the progress of the Internet of things has been unprecedented development. In the beginning, many of the code is not open source engineering, then the software developers found that the code can not be used to make money, so simply put the code online, so that more people to maintain and development, such as IBM's eclipse is the case. Of course, there are many like-minded people on the Internet, because the network let them go together, discuss the program together, discuss the software architecture, slowly the influence of the community will become more and more, this aspect do the best is Linux, KDE, GNOME and other software. Later, after the community developed, many big companies in order to let these open source software in their own hardware devices running, have to these open source projects into resources, the establishment of the corresponding foundation, the contribution code, such as HP, Fujitsu and so on. By the end of the period, some companies have taken the initiative to develop Open-source software, not counting on what they can bring to the company, but hoping to bring a broad popularity, such as Android software.

On the open source code, in fact, to say a lot of content, everyone has their own experience. Today, I would like to talk about the open source code some of my experience, of course, the project is basically the main C language project, for other search projects, framework projects, platform projects have little experience, also talk about bad, I hope we can understand.

Second, characteristics

Compared to private software, open source code has a lot of its own characteristics, we might as well chat and see,

(1) Open source code quality is different;

(2) Open source code in different forms, some complete software, and some just plug-ins;

(3) Open source code heat is not the same, a lot of software in fact, there is no one to maintain;

(4) Open source code generally does not have a dedicated support staff, many things need to solve their own;

(5) Open source code of the compilation environment is very different, should strive to find the right one.

Third, read the code

To read the code, you need a lot of upfront conditions. First, you have to compile the software, and then you need basic software knowledge, commonly used debugging methods must also be mastered; Finally, for the content of the software itself you need to understand that video playback to know the relevant knowledge of video codec, compression software to know the relevant algorithm compression, search engines need to know crawling, Word segmentation and Index Search related knowledge, of course, these are some basic conditions. So, if we have already done the above points, what should we do next?

(1) Download the code, the local compile pass, build version;

(2) Proficiency in the use of the software, understand the basic functions of the software and operating methods;

(3) According to the SOFTWARE function analysis software module structure;

(4) Find out where a software is most likely to be broken to set breakpoints, view the context;

(5) Around the context to judge the ins and outs of the code, gradually unfold;

(6) Try to modify the code, recompile verification of their own ideas, loop;

(7) Continuously expand the reading scope of the code, pay attention to record notes and share with netizens;

(8) Analysis of the code, bogey fast, Islands better read a line.

Iv. Compiling Environment

For C and C + +, the use of a more or less Windows environment and Linux environment. In fact, C language compilation is quite simple, Windows has Visual Studio Help, Linux above the autoconf and automake this powerful tool, the compilation seems to be an easy thing, but it is not,

(1) different compiler support standard for C language is not the same;

(2) Different versions of the compiler will also show inconsistent compilation;

(3) Many software often need to be modified, this is the test of basic skills;

(4) Some software need to rely on the Third-party library, the need to compile their own hands;

(5) Some software only supports a high version of the compiler, porting to a lower version of the compiler to rely on their own;

(6) Some software use Linux can compile through, but in Windows Cygwin is compiled but;

(7) Some software compile time is long, and memory occupies big, once compile fails, naught;

(8) header file failure, link failure, data type conversion failure, many cases need to deal with their own solution.

Five, select the code

There's a lot of code on the Web, but you have to choose the code that really works for you. Otherwise, for those low quality code, even if you download it is useless.

(1) Download the high quality code;

(2) To download the code to structure clearly, the preparation of norms;

(3) Download the code to be able to compile;

(4) The downloaded code is best always in the evolution;

(5) The downloaded code is best validated for a long time;

(6) Download can be used independently of a piece of code, good reading, good summary;

(7) Use the open source code widely used in the industry, reduce the cost, try not to fight alone.

vi. Download Tools

At present, the method of downloading code is still a lot of, of course, the simplest, most convenient or directly from the server to download the use, but now there are a lot of download software, for example,

(1) SVN tools;

(2) Git tools;

(3) FTP tools and so on.

Seven, looking for code

I usually look at the code is mainly C and C + + code primarily, the Java code will occasionally look at. Usually in addition to accumulate some of their own code, will also take the initiative to find some code, for example,

(1) To find the relevant code on the SourceForge;

(2) to Google code to find the above specific codes;

(3) to search the Apache web site for Java-related code;

(4) directly to the Open source project site search code;

(5) to csdn and other websites to download code, occasionally there will be unexpected harvest;

(6) to the book publishing house to download the book Appendix Code;

(7) Direct contact with the software author to see if you can get the relevant open source code.

Eight, study project:

(Coolplayer): a complete MP3 player

http://coolplayer.sourceforge.net/

Lua: A complete script virtual machine

http://www.lua.org

(FTK): A simple GUI solution that Windows and Linux can use

Http://code.google.com/p/ftk/downloads/list

(Ucos): Practical real-time embedded operating system code

Http://micrium.com/page/home

(EMule): Easy to use Peer-to-peer code

http://www.emule.org.cn/download/

(Irrlicht): Open source 3d engine

http://irrlicht.sourceforge.net/

(modified) TIGHTVNC: Remote control code, client and server

http://www.tightvnc.com/

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.