From 2 billion lines of code to instantly locate the code you are looking for, how does the candy cloud do?

Source: Internet
Author: User
Tags setcookie

There is a news report that Google has 2 billion lines of code (equivalent to 40 Windows system code, Windows has 50 million lines of code), tens of thousands of Google engineers at the same time to maintain and update the 2 billion lines of code, creating a Miracle on the Internet.

According to an engineer who has worked for Microsoft and Google, 2 billion lines of code, though more, are no big deal for Google, a scale company, but Google's real credit for this is that Google is able to put the 2 billion lines in the same library, Let all the engineers work on the same source library. This is so convenient. Anyone can read almost all the code to learn, and reusing other people's implementations becomes extremely easy. And before he goes to Google, when working at Microsoft, each group has its own library for each group. Working in a Windows Server group will not see the code for Office, and vice versa. If there is a need for shared code between groups and groups, complex coordination is required, and some teams are assigned to the task. It takes only a few seconds to view a few lines of code, and it takes a few days to delay.

From this introduction, Microsoft's development environment was a whole generation behind Google. As a result, engineers can see more widely used high-quality shared libraries at Google, more tools to improve development efficiency and eliminate duplication of effort, resulting in higher development efficiencies and faster growth of engineers, The end result is Google's business beyond Microsoft: Chrome beats ie, and Android beats Windows Mobile.

Why reusing code is so important to software development. I have just written the programmer to compile the code is called the raw code, and after a long run to prove the accuracy of the code is called ripe code, the raw code to become mature code, the cost of time and people's mental costs, more than 10 times times the written code. The code is written to debug, the function is basically correct after a variety of tests, and even the product online after a few months there are bugs, so in software development, should try to use cooked code to reduce unnecessary bugs.

The flourishing of open source software has promoted the progress of software technology, because the source code of open source software is open and can be used and modified by anyone. GitHub, the world's largest open source project, currently has open source project 800多万个, there are so many open source projects, search engines can also search tons of code, but the reality is: Most developers are still painting code, because the cost of finding reusable code is also very large, search engines to find code, Rubbish too much, in the open source project to find code, also very time-consuming, GitHub code search function is limited, github use is open source Elasticsearch search engine, search project no problem, but the search code basic can not use.

How can Google's employees can be as free to retrieve 2 billion lines of source code, so that their technology to grow faster.

This is our original intention of creating the Candy Cloud website: A website with 2 billion lines of source code (future will be more), can let you instantly locate the website of arbitrary code, the homepage of Candy Cloud website is this:
Candy Cloud Home

The candy Cloud has three main features:

1 The first feature is fast, candy cloud is you have seen the fastest search engine, faster than Baidu Google, Candy cloud search to what extent. Most search responses are below 1 milliseconds, and the candy cloud is the first real millisecond search engine in the world.

Because the response is fast enough, candy cloud in your input a word Fushidu return the current input of the search results, many times, the keyword has not been entered, the answer is already presented. Some people say that Baidu also seems to have this function, Baidu This function is called hot word hint, for example you enter a DI, hint Dirigeba, but the total number of hot words is also hundreds of thousands of, total text quantity is only a few m, and candy cloud code base, for example Chrome Source Library, Android-7.1 (Android Kernel 7.1 edition) Total text volume is above several G, candy Cloud still can do millisecond response, quick like lightning.

2 The second feature is the candy cloud has specifically for code search and custom search engines, code search requirements and ordinary keyword search is not the same, code search needs to accurately locate:

For example, the word "cookie" in the code, the Common keyword search engine can search for cookies, such as a total of 5000, if you want to more granular positioning, you can search the following words:

Cookies (cookie+ parentheses, the cookie you're looking for is a function

cookie[cookie+ Bracket, the cookie you're looking for is a number of groups

Cookie, cookie+ comma, the cookie you're looking for is a function parameter

Cookie Cookie+ semicolon, the cookie you're looking for is a variable.

Cookie space +cookie, the cookie you're looking for is preceded by a space

Cookie tab +cookie, the cookie you're looking for is preceded by a tab

. cookie period +cookie, the cookie you're looking for is a class member

->cookie pointer symbol +cookie, the cookie you're looking for is preceded by a pointer

Above these searches, in the Common keyword search engine, the support degree is limited or cannot search at all, the candy cloud fully supports, theoretically the candy cloud supports any character sequence search.

Search in Baidu ". Setcookie ("Add double quotes for more accurate positioning, otherwise it is not the result we need), Baidu returned the results are as follows (as the programmer expected results):
Baidu Search Code

Search for in GitHub. Setcookie (, however, GitHub can only return Setcookie results (with ". Setcookie (The search results are the same), as shown in the following illustration:
GitHub Search

Search the same in the candy cloud. Setcookie (, the result of the candy cloud return is really contained.) Setcookie code, as shown in the following illustration:
Candy Cloud Search

3 The third feature is that the candy cloud is a good classification of all code, first of all, the code of a project to form a library, and then all the libraries are categorized by application domain and programming language, as shown in the following illustration:
Candy Cloud Library

Google's 2 billion lines of code, although in a code base, I believe it is still possible by project, by language, according to the function of the search, otherwise search C + + code results appear Java code is very frustrating.

Google's code base is only available to Google employees, Candy Cloud code base all developers can use, users can upload and share their own code, we want to build the candy cloud as a treasure trove of knowledge for all developers.

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.