【转】 一些关于编程规范的网站

转自:A List of Coding Standard Websites

注:已将Google的编程规范(google-styleguide)整理进相应的列表。

 

Do you adhere to a certain coding style or standard when programming in your language of choice? If you are not following an official coding standard or a standard set-forth by your place of employment – perhaps you should start.

Why follow a coding standard? Standardize coding practices allow code to be more easily read by other programmers. Just imagine if you inherited code that was labeled as follows:

string a;
string b;
int flag1;
int flag2;

This might look like the code you wrote when you wrote your first program. However, if you saw this coding style in a professional environment you might have a difficult time understanding the meaning behind the variable names.

Coding standards are not necessarily dictated by the creator of the language. Many have just evolved into standards among the programmers who use the language.

I have compiled this list of several coding standards and styles. If want to start adhering to coding standards, I suggest you start with the official standards (if available). Also, check with your organization to see if they have a coding standards document already created.

.NET (C#/VB.NET)

PHP

C/C++

Python

Java

Ruby

HTML/CSS/Javascript

Objective-C

If I left out your favorite programming language, check out the Coding Conventions for languages at wikipedia.

Do you know of any other coding standards resources that I should include in the list above? Please share in the comments.
 

 

posted on 2012-08-13 13:55  风在竹林  阅读(208)  评论(0编辑  收藏  举报