First day of internship in Suzhou, first day of internship in Suzhou

Source: Internet
Author: User
Tags coding standards

First day of internship in Suzhou, first day of internship in Suzhou

0x01

On the first day of work today, I woke up about 5.30 in the morning. After all, I went to work at my internship for the first time and arrived at work at less than 8 o'clock. As I imagined, I really liked it. After searching for half a day, we found that there was no grid in our direction ...... AM to AM. I spent some time chatting and had a meeting at pm. I told the background of the project (not much here, but it should be kept confidential). Only then did I find that all projects should be developed using C ++, I was forced to report the java code. I want to learn C ++. Well, what the company wants to do is to read the coordinates of points with C ++, and then draw a picture, it involves vector computation, std: vector learning, vector line surface learning in computer, difference algorithm, besell, and B-spline. Although it has never been used, C ++ has a poor foundation, but I feel very calm and learn it.

0x02

I had a meal at noon, took a break, and started work in 1.30. A teacher contacted us about the location, went to the environment, and ran a sample in, draw a line or something.

0x03

The WY senior spoke about coding standards and collaborative development. For some developers, I feel that this is important at 01:10. WY started to learn programming in the second day. Think about yourself. I have never touched on programming languages in the second day.

① Alignment related

② Indent

③ The curly braces behind if are written in another line.

④ Variable alignment

⑤ Blank lines: Role of separating program paragraphs

6. I personally think it is very important. I will not talk about the specific importance.

Author, file name, function description, version, date (written in the file header)

Input parameter, output parameter, return value (written before function)

Function, principles (before statement block)

Indicates the modifier in the modified Code.

7. Form of Class: Public first, Private Second

The nickname method is functionName, valueName

Using const constants in Objective C ++ completely replaces macro Constants

Example: # define PI 3.14159

Const float PI = 3.14159

⑩ EPS

Eps is a constant stated in the function program. The default eps is 2 ^ (-52), which controls the iteration accuracy, which is equivalent to the infinitely small value in calculus.
Matlab
Eps (1/2) = 2 ^ (-53)
Eps (1) = 2 ^ (-52)
Eps (2) = 2 ^ (-51)

It seems that it is used in double.

Comparison between type variables and 0

Pointer comparison with 0 if (p = NULL)

 

No parameter. Fill it with void. Reason:

Writing void makes it clear that the function has no parameters. It is a good programming habit and has no impact on the program. You can write it without writing it.

 

Note:

If the parameter is a pointer and used as the input, add const

 

Related Article

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.