When I wrote the code today, I used the following braces and was told by the boss that I was out of specification. I wrote publicfunctiontest () {return ;} when I wrote the code today, I used the following braces and was told by the boss that I am out of specification. I know how to use braces.
Write as follows:
public function test(){ return;}
Reply content: There is no right or wrong about coding standards. It's right to listen to the boss in the team. No. Every company has its own code standards. Although I like pyramid standards, you have to follow the company's rules. Dude, you have to raise a question about this. Then I want to ask you, if this is your specification, then you will go back to your boss's theory? Java is your style. C and C ++ are many of your boss's styles. I also like your boss's style. I think the code scope of this style is more intuitive and casual, mainly based on code specifications.
To test the running block, comment out the condition statement.
If the backend is used, it mainly saves a blank line.
-----
For other answers, I think
Methods and classes can be post-configured, because it is unlikely to comment out the method header or Class header.
Conditional Control (if, while, and so on) can be used with a front graph to be careful ,,,
==================
This is JAVA:
This is PHP: This is PHP:
All of them are formatted with shortcuts. Is it symmetrical?
Isn't it just getting used to the style of an IDE!
Is the default style of the editor nonstandard?
Just a few words.
Hum ,,,
Let's talk about the sauce. I am also happy with your boss. At the beginning, we stipulated that we should not set the details. If we care about this, we should give more praise to our brothers. Let's write tcl. You are satisfied with the pack. You must write your code. I like the first one at the end of the row {
} There are no uniform requirements on the alignment of braces in the industry. Except for a few IDES (such as visaul studio), the code is automatically formatted as required by your boss; more IDE does not limit the format of braces. When I was studying. net in college, I also tried to change my habits to write the format required by your boss, but later I thought that taking up more than one line would reduce the readability of the code, so I gave up.
@ Bi Zhaoshang: Well, if your boss only asks you verbally, rather than formulating written specifications, then you should communicate with the boss and let him formulate well-written specifications, instead of talking about the nonstandard code of others. After all, the purpose of code specifications is to reduce the confusion in teamwork and reduce maintenance costs. However, as a technical manager, they only require others to write code according to their habits, that is counterproductive.
Of course, if the company requires such writing, so you need to take some time to familiarize yourself with and comply with the company's coding specifications. This reminds me that I often use xxx (){
// Code...
}
This is because I personally think that this is not a place (one's own view), it is relatively simple.
However, I have tried xxx () many times ()
{
}
I personally prefer the above. Actually, this is because the second line is written after xxx () {} (personal habits ),
I need to push two backspaces forward... (in fact, I am very lazy ).
However, if the team has specifications or colleagues who work together with programming cannot get used to them (Virgo forgive me), I will also write it in his way. After all, I will not be willful if I report to him.
Re answer: if the boss doesn't force you to write anything, you should follow your habits. After all, the boss should not be too harsh. If the project team has standardized it, it is best to standardize it. After all, everyone can see it and it can also improve project efficiency.