Years of skill accumulation in C ++ themes #1 -- code beautification of ultraedit

Source: Internet
Author: User
Tags ultraedit

Years of skill accumulation for C ++ themes #1 -- ultraeditCodeBeautification

Csdn under the water of the true meaning (http://blog.csdn.net/FantasiaX) produced

Small order:

Recently, some people have asked me why I don't want to write C # stuff. Well, that's it. In this year's annual plan, I set the "Annual technical topic" to the C ++ language, therefore, the learning content focuses on C ++. Obviously, last year's topic was C #. Of course, I can know new things in a gentle manner, so I often compare C ++ with what I have learned in C. For example, I still owe you an example, that is, the implementation of the multi-play delegate using the C ++ function pointer (specifically, the "function pointer array "). Also, some time ago, sisydney reminded me of the "smart pointer" knowledge. I 'd like to take a look at it recently. After learning the structure and principle of COM, return the result and check the InterOP of C #/. net ...... In short, haha, focusing on C ++, reviewing C #, only earning no compensation!

Body:

I have always recommended that you do not use ide when learning the XXXX language-you must use a plain text editor + compiler-this is enough for beginners, basics, and ...... Alas, in a word, this is cool "! Why? Because you can see all the things hidden behind it!

Look,ProgramThe Research Spirit of the staff is at a strange moment! Is it true that everything is thorough? Not yet ...... What else do we wear? (Laugh ......) I mean, isn't it good to keep a certain degree of healthy hiding? In fact, isn't c ++ and many other object-oriented languages like this: encapsulate data so that users cannot directly access it. What's more, for a newbie, if you let him see more information that he doesn't understand, it will scare people. Why? When a bug occurs, the house will be overwhelmed by cold sweat, and the error information will be rolled over several screens ...... This can only make C ++ lose more friends. Java has lost a great supporter-me!

In my opinion, you can use IDE for beginners, such as Visual C ++ 2005 express or Dev-C ++. We recommend that you use visual c ++ 2005 express for free! Absolutely genuine, huh, don't we bother school :)

But then again, after you play with the IDE in a certain language for a while, you should really look at what is under the hood. At this time, we should really use the plain text editor + compiler -- use the plain text editorSource codeWrite the code, and then go to the command line mode to multipart compilation and link the source code ...... It is best to do it manually. At this time, you will experience why # include can be followed by <> or "" -- it turns out that all the parameters of the compiler are at fault, these things have been put under hood by IDE.

There are too many plain text editors. Which one should I choose? Well, this is the same as selecting a gun in CS-anyone who chooses it praises it and makes sure someone will scold it. I chose ultraedit. The latest version is 12.20b. Why? First, the domain name is good, and second, the company bought batch registration numbers.

After installation, create a new file and enter several C/C ++ keywords in it! No response ...... Save it. Save it with the suffix ". cpp", and then the keywords are highlighted in color. I tried to write a hello World and compile it with the compiler. Not bad!

However, Microsoft ide has been spoiled by Microsoft for so many years. Looking at how ugly the ultraedit code is, there is no automatic code prompt ...... In particular, the most annoying thing is: no matter where it is, the right curly braces always indent a tab to the right-what is the format? Really annoying.

It doesn't matter! I changed it! Open the help document, find the relevant content and read it again, optimized some, and found some information on the Internet "codu" (Google + Baidu. Therefore, the following configuration is performed:

    1. To open the configuration ue dialog box, click Advanced> Configuration...
    2. Find editor in the left branch
    • Select Show auto... in auto-complete to enable the auto-completion function. I feel no worse than VC!
    • In word warp/TAB settings, you can adjust the ratio of tabs to spaces. For cross-platform projects, you must use spaces instead of tabs.
  • Find editor display in the left branch
      • Code folding refers to code folding, which can be customized according to your preferences.
      • The auto indent new linein formatting is the scaled-down state behind the enterpress key, which is determined by the parameters in the wordfile.txt file under the ueinstallation directory. Open wordfile.txt
        • /Indent strings = "{" "if" "else" ":" indicates the characters that follow the lines and the next line is indented. It is OK to keep only the colon. If the colon is not retained, the problem may occur again and you do not know where the problem is.
        • /Unindent strings = "}" refers to the characters after which the indentation is reduced, corresponding to the previous line. The left curly braces above have been deleted. Naturally, this should also be deleted.
        • If you are interested, you can adjust other parameters by yourself ~~~
      • You can set your favorite color highlight in syntax highlightinging. Select highlight new file as C/C ++, so that as long as a new file is opened, it will be treated as a C/C ++ file, without saving it as. cpp first.
  • Finally, if you want to adjust the font of the editor -- not here -- in View> set font... Of the UE main menu. Select a beautiful font by yourself: I use Georgia 14 italics, and the code looks artistic-VC can't do this! It does not support Italics! Every time I give a comment to Ms, I receive the following answers: Thanks, we will implement it in next version, and it starts with vs2002.
  • Okay, now let's look at our code! Pretty! Do you have any good optimization methods to post them later!

    Legal disclaimer : BenArticleProtected by intellectual property law, if any organization or individual needs to repost this article, it is necessary to ensure the integrity of the article (any deletion or modification without the author's permission will be deemed as an infringement ). If you need to reprint the document, be sure to indicate the source of the article Csdn To protect the rights and interests of the website, please note that the author of the article is Liu tiemeng ( Http://blog.csdn.net/FantasiaX ), And Liutm@beyondsoft.com Send an email indicating the position and purpose of the article. Please repost this legal statement when reprinting. Thank you!

    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.